//组件
<a-table> 属性中加入属性:
:rowClassName="setRowClassName"
//js
//setRowClassName为自定义返回行的样式名称,record,index参数为行数据和行索引
setRowClassName(record,index){
//判断并返回行的样式名称
if(record.xxx == '1'){
return "bg-blue"
}else if(record.xxx == '2'){
return "bg-yellow"
}
}
//css
::v-deep .bg-blue{
background-color:blue;
}
::v-deep .bg-yellow{
background-color:yellow;
}