element表格单独设置某一列的背景色

在这里插入图片描述

productiontableStyle(column) {
    if(column.columnIndex === 4 || column.columnIndex === 5||
     column.columnIndex === 8|| column.columnIndex === 9||
      column.columnIndex === 12|| column.columnIndex === 13||
      column.columnIndex === 16|| column.columnIndex === 17||column.columnIndex === 18) {
        return {"background":"#f2f8fe","color": "#1989fa"} 
    }
},
 <el-table :data="tableData" style="width: 100%" :span-method="objectSpanMethod" :cell-style="productiontableStyle">
      <el-table-column align="center" label="" prop="bigCategoryName" fixed></el-table-column>
      <el-table-column align="center" label="" prop="smallCategoryName" fixed></el-table-column>
</el-table>
上一篇:AOA-LSTM多输入回归预测|算术优化算法-长短期神经网络|Matlab


下一篇:Nuxt.js 应用中的 schema:resolved 事件钩子详解