/** 字符串超长截取省略号显示 */
Vue.filter('ellipsis', function (value, vlength = 25) {
if(!value){
return "";
}
console.log('vlength: '+ vlength);
if (value.length > vlength) {
return value.slice(0, vlength) + '...'
}
return value
})
字符串超长截取省略号显示
最新推荐文章于 2024-07-30 10:27:19 发布