elementUI中 table 中更改某行样式
1、el-table标签添加 属性 :row-class-name="tableRowClassName"
2、定义属性方法
//row是获取到某一行的数据 orderTimeFlag 是我列表数据中的一个字段
//用来判断哪些行需要颜色改变
tableRowClassName({ row }) {
if (row.orderTimeFlag == "1") {
return "red-row";
}
},
3、设置背景颜色及其他样式
// /deep/ 新的使用方法
::v-deep {
.el-table .red-row {
font-size: 12px;
font-weight: 700;
color: red !important;
}
}