问题:
今天遇到一个 elementUI table 表格内容展示超长,在表格列上添加 show-overflow-tooltip 属性之后,超长的内容没有出现省略号。
代码:
<el-table-column align="left" prop="name" label="名称" show-overflow-tooltip>
<template slot-scope="scope">
<el-button type='text'>{{scope.row.name}}</el-button>
</template>
</el-table-column>
解决:
只需要将按钮换成 span 标签就可以了,并且 template 里面和 span 外面不要有 div 包裹。