elementUI在使用中遇见的问题之table

116 阅读1分钟

自定义表头


/** * @description 自定义表头 */ 
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"); }, }, }), ]); 
}, 
// switchClick(index, column, type) { 
// this.orderColumns = [ 
// {
// type: type, 
// orderColumn: this.column[index].prop, 
// },
// ]; 
// }, 
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{     height100% !important;     } 
//设置高优先,以覆盖内联样式 .el-table__fixed { height100% !important;      }