<a-table
:columns="innerColumns"
:pagination="false"
:data-source="dataInner"
:rowClassName="setHeaderRowClassName"
>
<!-- ...其他模板内容... -->
</a-table>
定义类名
const setHeaderRowClassName = (record, index) => {
console.log(record,index,'log'); //子表的每行数据 和 每行的下标
if (index == 0) {
return 'custom-header-class'; // 自定义的表头颜色的类名
}
}
样式 ----将table数据中的第一行的背景色设置为粉色
:deep(.custom-header-class){
background-color: pink;
}