问题描述:在table中只更改指定的某一竖列的样式,通过element框架自带的 class-name实现。

 <el-table
                id="tableRef"
                    :data="tableData"
                    ref="multipleTable1"
                    border
                    style="width: 100%;background-color:#fff;"
                    tooltip-effect="dark">
                    <el-table-column prop="affiliatingScenicSynopsis"
                     label="景区简介" width="220" align="center" 
                     class-name ='over2Hidden'> 
                     </el-table-column>
                   
                </el-table>
//这里需要注意的是,需要去掉style标签中的scope属性,不然会不生效
<style  lang="scss">
.over2Hidden{
  .cell{
    text-overflow: -o-ellipsis-lastline;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical; 
  }
  
}
</style>
GitHub 加速计划 / eleme / element
15
3
下载
A Vue.js 2.0 UI Toolkit for Web
最近提交(Master分支:4 个月前 )
c345bb45 1 年前
a07f3a59 * Update transition.md * Update table.md * Update transition.md * Update table.md * Update transition.md * Update table.md * Update table.md * Update transition.md * Update popover.md 1 年前
Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐