Commit c1155b3b authored by Leopoldthecoder's avatar Leopoldthecoder Committed by 杨奕

Table: avoid doLayout continuous executing

parent 80e60efc
...@@ -345,6 +345,7 @@ ...@@ -345,6 +345,7 @@
this.updateScrollY(); this.updateScrollY();
this.layout.update(); this.layout.update();
this.$nextTick(() => { this.$nextTick(() => {
if (this.destroyed) return;
if (this.height) { if (this.height) {
this.layout.setHeight(this.height); this.layout.setHeight(this.height);
} else if (this.maxHeight) { } else if (this.maxHeight) {
...@@ -355,7 +356,7 @@ ...@@ -355,7 +356,7 @@
if (this.$el) { if (this.$el) {
this.isHidden = this.$el.clientWidth === 0; this.isHidden = this.$el.clientWidth === 0;
if (this.isHidden && this.layout.bodyWidth) { if (this.isHidden && this.layout.bodyWidth) {
setTimeout(() => this.doLayout()); setTimeout(() => this.debouncedLayout());
} }
} }
}); });
...@@ -496,6 +497,7 @@ ...@@ -496,6 +497,7 @@
}, },
destroyed() { destroyed() {
this.destroyed = true;
if (this.windowResizeListener) removeResizeListener(this.$el, this.windowResizeListener); if (this.windowResizeListener) removeResizeListener(this.$el, this.windowResizeListener);
}, },
...@@ -536,7 +538,8 @@ ...@@ -536,7 +538,8 @@
resizeProxyVisible: false, resizeProxyVisible: false,
// 是否拥有多级表头 // 是否拥有多级表头
isGroup: false, isGroup: false,
scrollPosition: 'left' scrollPosition: 'left',
destroyed: false
}; };
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment