重點的代碼:
:row-style="setRowStyle"
這個屬性就是在table標籤綁定的
:row-style="setRowStyle"
setRowStyle(row) {
if (row.row.isPart == true) {
return 'color:blue;'
}
},
具體代碼:
hmtl
<el-table width="100%" :data="gridData" border fit highlight-current-row :header-cell-style="{background:'#199ED8'}" :row-style="setRowStyle">
<el-table-column label="序號" type="index"></el-table-column>
</el-table>
js中就是方法的調用就好了
setRowStyle(row) {
if (row.row.isPart == true) {
return 'color:blue;'
}
},