行的 className 的回调方法,传入参数:row:当前行数据index:当前行的索引
bug:实际的index是鼠标经过的行的索引
u5rb5r591#
------------------------------------------------------------- rowClassName(row, index){ console.log(index); if (index===0) { return 'firstComparisonColor'; } else if (index === 2) { return 'secondComparisonColor'; } } ------------------------------------------------------------- .secondComparisonColor{ background-color: #fff; color: #999 ; } .ivu-table .demo-table-info-row td{ background-color: #2db7f5; color: #fff; }
1条答案
按热度按时间u5rb5r591#
------------------------------------------------------------- rowClassName(row, index){ console.log(index); if (index===0) { return 'firstComparisonColor'; } else if (index === 2) { return 'secondComparisonColor'; } } ------------------------------------------------------------- .secondComparisonColor{ background-color: #fff; color: #999 ; } .ivu-table .demo-table-info-row td{ background-color: #2db7f5; color: #fff; }