<el-table
:data="tableData"
v-loading="loading"
:row-class-name="tableRowClassName"
ref="multipleTable"
class="bgf"
border
header-row-class-name="lm-header-row"
cell-class-name="lm-cell"
style="width: 100%;"
>
:row-class-name是設置的關鍵 table我就不寫全了,比較麻煩
tableRowClassName({row}){
console.log(row.reply_status);
if(row.reply_status === 2){
return 'warning-row';
}
},
row是獲取到某一行的數據 reply_status是我列表數據中的一個字段用來判斷哪些行需要顏色改變
改變css樣式
/deep/.el-table .warning-row {
background: rgba(0,255,255, 0.5);
}