1、html 部分
<el-table
:data="gridData"
fit
border
:row-class-name="role != 0 ? status_change : ''" //:row 属性
@selection-change="handleSelectionChange"
:header-cell-style="{ background: '#f5f7fa', color: '#606266' }"
>
2、 methods 方法里的:
status_change(row) {
if(row.row.isBlack === 0){
return "table-black-info-row"
}
if (row.row.check == "0" && row.row.message) {
return "table-info-row";
}
},
3、css 样式
.table-black-info-row td{
background:#f56c6c;
color:#1f1f20;
}
.table-info-row td {
border-bottom: 2px dashed red;
border-top: 2px dashed red;
}
.table-info-row td:first-child {
border-left: 2px dashed red;
}
.table-info-row td:last-child {
border-right: 2px dashed red;
}