前端样式 实现两行 超出部分...显示

实现两行 超出部分…显示

  1. 纯css 只对webkit内核浏览器有效
line-height:37rpx;
overflow:hidden;
text-overflow:ellipsis;
display:-webkit-box;
-webkit-line-clamp:2;
-webkit-box-orient:block-axis;
  1. js
{{item.name.length>20?item.name.slice(0,20)+'...':item.name}}

猜你喜欢

转载自blog.csdn.net/etemal_bright/article/details/84580071
今日推荐