<el-table-column
prop=“carOwner” label=“车主”
header-align=“center” align=“center”>
<template slot-scope=“scope”>
<div style=“position: relative”>
<div class=“hiddenOverText” :title=“scope.row.carOwner”>{{scope.row.carOwner}}</div>
<span v-if=“JSON.stringify(scope.row.carOwner).length > 36” class=“overText”>…</span>
</div>
</template>
</el-table-column>
// 样式
.hiddenOverText {
max-height: 70px;
overflow: hidden;
text-overflow: ellipsis;
position: relative;
line-height: 23px;
}
.overText {
position: absolute;
bottom: 0px;
content: ‘…’;
right: -8px;
}
.noText {
width: 100% !important;
}
// 效果图
————————————————
版权声明:本文为CSDN博主「北海军」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_39237755/article/details/83411477