vue中字符串文本长度超出显示省略号...及悬浮显示全部文本
效果图<el-form-item :label="$t('operationStockInAccept.reasonForReturn') + ':'"><span class="spanStyle" :title="warehousingEntry.enterReason">{{warehousingEntry.enterReason}}</span><
·
效果图
<el-form-item :label="$t('operationStockInAccept.reasonForReturn') + ':'">
<span class="spanStyle" :title="warehousingEntry.enterReason">{{warehousingEntry.enterReason}}</span>
</el-form-item>
ps:需要设置span 的title属性,这个属性用于鼠标停留在上面就会显示全部文本
样式
.spanStyle {
display: inline-block;
white-space: normal;
width: 100px;
overflow: hidden; /*超出的文本隐藏*/
text-overflow: ellipsis; /* 溢出用省略号*/
}
更多推荐
已为社区贡献11条内容
所有评论(0)