Vue项目中使用element-ui,表格动态样式
<el-table :row-style="tableRowClass">
// 。。。
</el-table>
methods: {
tableRowClass({row, rowIndex}) {
// row 该行数据, rowIndex 该行索引
if(rowIndex%2 == 0) {
return {"color": "#FF0000"} //!返回值要是对象格式!
}
}
}