el-table的每列两行溢出隐藏怎么设置
elementPlus中的el-table如何设置多行溢出隐藏

这里是elementPlus的官方文档地址 https://element-plus.org/zh-CN/component/table.html
table中的table属性中有show-overflow-tooltip属性,但是只支持单行溢出隐藏
如何改成两行呢?
在审查元素中我们发现.el-tooltip这个类名是溢出隐藏的样式,原本的样式为
我们只需要更改样式即可如下:
css
// 超出两行溢出隐藏真实悬浮提示
.el-table .cell.el-tooltip {
display: -webkit-box;
-webkit-box-orient: vertical;
line-clamp: 2;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
white-space: normal !important;
}
更改完之后的审查元素

致此完成