template
<el-table-column prop="daNumber" label="编码号" width="260" show-overflow-tooltip fixed :render-header="renderHeader"> <template slot-scope="{ row, $index }"> <div class="bianhaoInput" style="display: inline-block;"> <el-input size="small" v-model="row.daNumber" disabled></el-input> </div> </template> </el-table-column>
methods
//el-table-column label设置 //h(param1, param2, param3)里:param1是这个元素的标签名,param2是这个元素的属性,class之类;param3是这个元素的innerHtml和子元素组成的数组 renderHeader (h, { column, $index }){ let currentLabel = column.label; return h(‘span‘,{},[ h(‘span‘,{class: ‘headerIcon‘},‘*‘), h(‘span‘,{},currentLabel) ]) },