element表头添加红色星号
1.在标签中添加 :header-cell-class-name=“start”
<el-table :header-cell-class-name="start">
2.在script中谱写
const start=({row,rowIndex,column,columnIndex})=> {
if (columnIndex == 9) {
return 'start'
}
}
最后在css中,v3中如果表格添加了表单校验提示信息可能会将输入框顶上去,可以定义类名tableTrayQuality穿透
(这只是其中之一的方法)
:deep(.tableTrayQuality .el-form-item){
margin-bottom: 0 !important;
}
:deep(.el-table table tr th.start div:before){
content: '*';
color:red;
}
当我们给表格去添加校验,可能校验提示的文字会把输入框顶上去
可以给el-table添加个类名去设置样式。缺点是校验提示的文字不会显示
如果有更好的方法欢迎评论
:deep(.tableTray .el-form-item){
margin-bottom: 0 !important;
}