1、首先在表格中添加
header-row-class-name="childHeader" ,这是给tr行添加的类名
<ProTable
ref="childTable"
:columns="childColumns"
:data="scope.row.family"
:data-callback="dataCallback"
:tool-button="false"
:pagination="false"
:card="false"
header-row-class-name="childHeader"
></ProTable>
2、样式部分的代码如下
:deep(.childHeader > th) {
background-color: #333 !important;
}
这样才能把设置在th行内的默认style样式覆盖掉