vue+elementui项目,table项内容超过确定行以“...”显示剩余部分的实现


<el-table-column slot="tbiMemo" label="厂商介绍" align="left" minWidth="250px">
    <template slot-scope="scope">
          <div class="showInline">{{ scope.row.tbiMemo }}</div>
    </template>
</el-table-column>

 

1、超过两行以“...”显示剩余部分

overflow: hidden;
-webkit-line-clamp: 3;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;

 

.class {
  overflow: hidden;
  display: -webkit-box;
  word-break: break-all;
  font-weight: 900;
  text-overflow: ellipsis;
  /*! autoprefixer: off */
  -webkit-box-orient: vertical;
  /*! autoprefixer: on */
  -webkit-line-clamp: 2;
}

 但是以上做法会造成下面这样,

 

如果没有特定要求的话,你可以使用单行显示,文本超过溢出以“...”

显示

 
 

  .showInline {
      overflow:hidden;
      text-overflow:ellipsis;
      white-space:nowrap
  }

  

 

 

 

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM