1.el-tooltip引入
<el-table-column label="店铺名称" align="center" prop="shopName">
<template slot-scope="scope">
<el-tooltip class="item" effect="light" placement="top">
<div v-html="scope.row.shopId" slot="content"></div>
<div class="tooltip">{{ scope.row.shopName }}</div>
</el-tooltip>
</template>
</el-table-column>
2.如果要设置文字超限处理,可设置tooltip样式,如无,不需要加tooltip样式
.tooltip {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
本文介绍了如何在 Element UI 的表格组件中使用 el-tooltip 组件来显示额外的信息,并提供了设置文字超限时的处理方法。
1万+

被折叠的 条评论
为什么被折叠?



