问题:
el-table使用了插槽后配置show-overflow-tooltip不生效
解决方案:
手动添加样式
<el-table-column
label="项目名称"
align="center"
width="120"
:show-overflow-tooltip="showOverflowTooltip"
>
<template slot-scope="scope">
<div v-for="(name,index) in scope.row.nameList" :key="index" :class="{ 'showOverflowTooltip': showOverflowTooltip }">
{{ name}}
</div>
</template>
</el-table-column>
<style lang="less" scoped>
.showOverflowTooltip {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>