el+vue实战 ③ el-col只显示一行,多余部分用省略号表示

效果展示:

代码样式设置:

<el-col
    style="
     width: 10rem;
     white-space: nowrap;
     text-overflow: ellipsis;
     overflow: hidden;
</el-col>

其中 width:10rem:设置一行显示字体的宽度。

        white-space:nowrap:规定在段落中的文本不换行。

        overflow:hidden:元素的内容若超出了给定的宽度和高度属性,那么超出的部分将会被隐藏,不占位

        text-overflow:ellipsis:显示省略符号来代表被修剪的文本。

猜你喜欢

转载自blog.csdn.net/zujiasheng/article/details/123348678