摘要:筛选器:{formatLongText{if{return“None”;}elseif{returnvalue.substr(0,8)+“…”;}否则{returnvalue;}},省略号{if(!Value)return‘‘if{return Value.slice+‘…‘}return Value},}用法<el table columnlabel=“Feedback content”prop=“content”align=“left”><templateslot scope=“scope”><span>{scope.row.content|省略号}}˂/span></template></el table column>
filters: {
formatLongText(value) {
if(value===undefined||value===null||value===''){
return '暂无';
}else if(value.length>8){
return value.substr(0, 8) + '...';
}else{
return value;
}
},
ellipsis(value, limit) {
if (!value) return ''
if (value.length > limit) {
return value.slice(0, limit) + '...'
}
return value
},
}
用法
<el-table-column label="反馈内容" prop="content" align="left">
<template slot-scope="scope">
<span>{{ scope.row.content | ellipsis(24) }}</span>
</template>
</el-table-column>