对于el-table对于超出长度限制的文本使用省略号处理方式
一、 在 标签中加入 :show-overflow-tooltip='true'
<el-table-column
prop="prop"
label="lable"
min-width='200'
:show-overflow-tooltip='true' />
二、使用过滤器
1.设置过滤器
filters: {
ellipsis(value) {
if (!value) return "";
if (value.length > 20) { // 设置字符超过20个后使用...
return value.slice(0, 30) + "...";
}
return value;
}
},
2.使用过滤器
<el-table-column label="lable" min-width="200">
<template slot-scope="scope">
<span>{{scope.row.content | ellipsis}}</span>
</template>
</el-table-column>