mirror of https://github.com/ElemeFE/element
Table: fix table header slot not reactive #21297
parent
f14b5ba540
commit
23a58931cd
|
@ -306,6 +306,15 @@ export default {
|
|||
owner.store.commit('insertColumn', this.columnConfig, columnIndex, this.isSubColumn ? parent.columnConfig : null);
|
||||
},
|
||||
|
||||
beforeUpdate() {
|
||||
if (this.$slots.header && this.$scopedSlots.header) {
|
||||
this.columnConfig.renderHeader = (h, scope) => {
|
||||
const renderHeader = this.$scopedSlots.header;
|
||||
return renderHeader ? renderHeader(scope) : this.columnConfig.label;
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
destroyed() {
|
||||
if (!this.$parent) return;
|
||||
const parent = this.$parent;
|
||||
|
|
Loading…
Reference in New Issue