自定义表头
resetHeader(h, { column, $index }) {
return h("div",
[ h("span", column.label),
h("i", { class: { "el-icon-sort-down": true, iconStyle: true, myStyle: this.insetStyle($index), },
style: "color:#C0C4CC",
on: { click: () => {
this.switchClick($index, column, "desc"); }, }, }), h("i", {
class: { "el-icon-sort-up": true, iconStyle: true, myStyle: this.insetStyle2($index),
},
style: "color:#C0C4CC",
on: { click: () => {
this.switchClick($index, column, "asc"); }, }, }), ]);
},
insetStyle(index) {
return ( this.orderColumns[0] &&
this.column[index].prop === this.orderColumns[0].orderColumn &&
this.orderColumns[0].type === "desc" );
},
insetStyle2(index) {
return ( this.orderColumns[0] &&
this.column[index].prop === this.orderColumns[0].orderColumn &&
this.orderColumns[0].type === "asc" );
},
表格BUG
1.表格右侧固定列显示一条横线
.el-table__fixed-right{ height: 100% !important; }
//设置高优先,以覆盖内联样式 .el-table__fixed { height: 100% !important; }