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

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 ''
   }
}

猜你喜欢

转载自www.cnblogs.com/ljr210/p/11739002.html