element ui —table中,单独改变某个列或者行的属性 例如(改变某个列的背景颜色、去除表格分割线)
1.在el-table中添加
<el-table
:cell-style="columnStyle"
:default-sort="{prop: 'id', order: 'descending'}"
style="width: 100%;">
其中columnStyle是自己写的一个方法
2.在methods里面写方法
columnStyle ({row, column, rowIndex, columnIndex}) {
// if (this.dataList[rowIndex].operateStatus === '验收被驳回') {
// return { 'background-color': '#ffeed5' }
// }
if (columnIndex === 0) {
// 返回去除表格中的横线
// return 'border: none;'
// 返回背景颜色
return 'background-color:#fff9e9;!important'
}
}