方式1:
直接在标签上添加上属性值:
1<el-table 2 :header-cell-style="{background:'#F3F4F7',color:'#555'}" 3></el-table>
方式2:
在method里面写上方法:
1rowClass({ row, rowIndex}) { 2 console.log(rowIndex) //表头行下标 3 return 'background:#F3F4F7;color:#555' }
然后在el-table标签中使用方法:
<el-table :header-cell-style="rowClass"></el-table>