Skip to content

Commit

Permalink
Table: fix table header slot not reactive
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangqingyang committed Sep 3, 2021
1 parent 50a464e commit bbed981
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/table/src/table-column.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,16 @@ export default {
owner.store.commit('insertColumn', this.columnConfig, columnIndex, this.isSubColumn ? parent.columnConfig : null);
},

beforeUpdate() {
// #20453
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;
Expand Down

0 comments on commit bbed981

Please sign in to comment.