<template > 使用表头自定义的插槽 <template slot="header"> <!-- 这里使用p会自动继承父的宽度,就可以设置文字超过省略了 --> <p class="tooltip">哈哈哈哈哈哈合人</p> </template> </el-table-column> </template>
.tooltip { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; //这里控制超出多少行开始用省略号代替 -webkit-box-orient: vertical; } //在网络上搜索到的