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; }