テキスト内容が 10 文字を超えると省略記号が表示されます……
-
レンダリング
-
フィルターコード
filters: { ellipsis(value, count) { if (!value) return '' if (value.length > count) { return value.slice(0, count) + '...' } return value } },
-
使用
<li v-for="(item,index) in classifyList" :key="index">{ { item.name|ellipsis(10)}}</li>