vue: 修改table中某一列的样式

时间:2019-10-25 17:41:16   收藏:0   阅读:1143

1. 在 el-table组件中添加属性

<el-table
:cell-style="changeCellStyle">
  .........
</el-table>

 

2. 方法中: 进行相应修改

changeCellStyle (row, column, rowIndex, columnIndex) {
   if(row.column.label === "列标题"){
       return ‘color: blue‘  // 修改的样式
   }else{
       return ‘‘
   }
}

 

原文:https://www.cnblogs.com/ljr210/p/11739002.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!