|
@@ -55,14 +55,14 @@
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
- calcPaneInstances(isLabelUpdated = false) {
|
|
|
+ calcPaneInstances(isForceUpdate = false) {
|
|
|
if (this.$slots.default) {
|
|
|
const paneSlots = this.$slots.default.filter(vnode => vnode.tag &&
|
|
|
vnode.componentOptions && vnode.componentOptions.Ctor.options.name === 'ElTabPane');
|
|
|
// update indeed
|
|
|
const panes = paneSlots.map(({ componentInstance }) => componentInstance);
|
|
|
const panesChanged = !(panes.length === this.panes.length && panes.every((pane, index) => pane === this.panes[index]));
|
|
|
- if (isLabelUpdated || panesChanged) {
|
|
|
+ if (isForceUpdate || panesChanged) {
|
|
|
this.panes = panes;
|
|
|
}
|
|
|
} else if (this.panes.length !== 0) {
|
|
@@ -177,7 +177,7 @@
|
|
|
this.setCurrentName('0');
|
|
|
}
|
|
|
|
|
|
- this.$on('tabLabelChanged', this.calcPaneInstances.bind(null, true));
|
|
|
+ this.$on('tab-nav-update', this.calcPaneInstances.bind(null, true));
|
|
|
},
|
|
|
|
|
|
mounted() {
|