<el-table-column label="描述" width="200" align="left" prop="description">
<template v-slot="scope">
<el-tooltip
class="item ellipsis"
effect="dark"
placement="top"
:content="scope.row.description"
popper-class="tooltipLines"
>
<div>
{
{ scope.row.description }}
</div>
</el-tooltip>
</template>
</el-table-column>
<style scoped>
.ellipsis {
white-space: wrap; /* 防止文本换行 */
overflow: hidden; /* 隐藏超出的文本 */
text-overflow: ellipsis; /* 显示省略号 */
width: 180px; /* 设置元素宽度,根据需要调整 */
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
text-align: justify;
}
</style>
<style lang="css">
.el-tooltip__popper {
max-width: 40%;
}
</style>
https://blog.csdn.net/qq_51657072/article/details/124267624