![](https://camo.githubusercontent.com/64fc457bffe0e391cb7da74d6f8eb2bd6dae1a2b948377fc408ad839016abb9d/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f646570656e64656e63792d76657273696f6e2f7675652d746578742d636f6c6c617073652f7675652d64656d69)
Vue3 Demo
Vue2 Demo
props: {
text: {
// The shown content.
type: String,
required: true,
},
collapseLines: {
// The lines shown when it is collapsed.
type: [ String, Number ],
default: 2,
},
width: {
type: String,
default: '200px',
},
uniqueKey: {
// Used for the `id` attribute when it is rendered by `v-for`.
type: [ String, Number ],
require: false,
},
expandText: {
type: String,
default: 'Expand',
},
collapseText: {
type: String,
default: 'Collapse',
},
},
- Install
- Confirm
playgrounds/vue3/src/App.vue
<script setup lang="ts">
// For build
// import textCollapse from 'vue-text-collapse'
import textCollapse from './../../../src'
// ...
- Run the dev script
pnpm preview:3
pnpm preview:2