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',
},
},
<script setup lang="ts">
// For build
// import textCollapse from 'vue-text-collapse'
import textCollapse from './../../../src'
// ...