在methods方法之外写
filters: {
ellipsis(value) {
if (!value) return ''
if (value.length > 22) {
return value.slice(0, 22) + '...'
}
return value
}
},
使用
<div :title="scope.row.controlInfo">{{ scope.row.controlInfo | ellipsis }}</div>