表头换行显示
<el-table :data="list" class="table-border text-noellipsis">
<el-table-column prop="rptDate" label="日期" :formatter="formatDate"></el-table-column>
<el-table-column prop="rgstrQty" label="截至该日期已注册的商家数|(A)" :render-header="renderheader"></el-table-column>
</el-table>
methods: {
// 表头换行
renderheader(h, { column, $index }) {
return h('span', {}, [
h('span', {}, column.label.split('|')[0]),
h('br'),
h('span', {}, column.label.split('|')[1])
])
},
}
效果图