给render-header 动态绑定一个函数
<el-table-column prop="spec" label="规格型号" :render-header="addRedStar" width="200px">
<template slot-scope="scope">
<el-input type="input" :disabled="scope.row.classifyTree !== '增减项'" size="small" clearable=""
placeholder="请输入规格型号" @blur="blurEvent(scope.row, scope.$index, scope.column)" v-model="scope.row.spec">
</el-input>
</template>
</el-table-column>
// 给表头加必填符号*
addRedStar(h, { column }) {
return [
h("span", { style: "color: red" }, "*"),
h("span", " " + column.label),
];
},