<el-table :data="milestoneForm.milestone_data" :model="milestoneForm" ref="milestoneForm" border stripe
style="100%" class="tasktable" :row-class-name="tableRowClassName" :header-cell-class-name="star">
<!-- -->
</el-table>
1 使用 :header-cell-class-name="star" 属性
star({ row, rowIndex, column, columnIndex }){
if (columnIndex !=4 && columnIndex != 5) {
return "star";
}
},
2 在start中设置你想要添加的必填表头index
.el-table__header-wrapper th.star ::before {
content: '*';
color: red;
margin-right: 0.02rem;
font-size: 0.12rem;
}
3 在css 中设置红星样式
效果如图显示