在<el-table>的标签上添加:cell-style属性
<el-table :data="gridData" border :cell-style="columnStyle"></el-table>
在methods中添加对应的columnStyle方法
columnStyle({ row, column, rowIndex, columnIndex }) {
//注意:第一行的索引为0
if (columnIndex === 2) {
//如果有多个css样式,使用;隔开
return 'color:red;cursor: pointer'
}
},