在el-table
里有這么一個屬性row-class-name
,是一個回調函數,可以給el-table__row加class。
舉個栗子:
template
1
|
<
el-table
:data="dataTable" border style="width: 100%" :row-class-name="tableRowClass">
|
script
methods: {
tableRowClass(val){
if(val.row.excessTime == '已結束'){
return 'row-bg';
}else{
return '';
}
}
}
style
1
2
3
4
5
|
<style>
.el-table .row-bg{
background
:
#5CB85C
;
}
</style>
|