Table: fix high CPU consumption

pull/8352/head
Leopoldthecoder 2017-11-17 12:22:55 +08:00 committed by 杨奕
parent 1af6989544
commit 23e86bcf1a
3 changed files with 3 additions and 10 deletions

View File

@ -1990,6 +1990,7 @@ You can customize row index in `type=index` columns.
| setCurrentRow | used in single selection Table, set a certain row selected. If called without any parameter, it will clear selection. | row |
| clearSort | clear sorting, restore data to the original order | — |
| clearFilter | clear filter | — |
| doLayout | Refresh the layout of Table. When the visibility of Table changes, you may need to call this method to get a correct layout | — |
### Table Slot
| Name | Description |

View File

@ -2053,6 +2053,7 @@
| setCurrentRow | 用于单选表格,设定某一行为选中行,如果调用时不加参数,则会取消目前高亮行的选中状态。 | row |
| clearSort | 用于清空排序条件,数据会恢复成未排序的状态 | — |
| clearFilter | 用于清空过滤条件,数据会恢复成未过滤的状态 | — |
| doLayout | 对 Table 进行重新布局。当 Table 或其祖先元素由隐藏切换为显示时,可能需要调用此方法 | — |
### Table Slot
| name | 说明 |

View File

@ -345,7 +345,6 @@
this.updateScrollY();
this.layout.update();
this.$nextTick(() => {
if (this.destroyed) return;
if (this.height) {
this.layout.setHeight(this.height);
} else if (this.maxHeight) {
@ -353,12 +352,6 @@
} else if (this.shouldUpdateHeight) {
this.layout.updateHeight();
}
if (this.$el) {
this.isHidden = this.$el.clientWidth === 0;
if (this.isHidden && this.layout.bodyWidth) {
setTimeout(() => this.debouncedLayout());
}
}
});
}
},
@ -497,7 +490,6 @@
},
destroyed() {
this.destroyed = true;
if (this.windowResizeListener) removeResizeListener(this.$el, this.windowResizeListener);
},
@ -538,8 +530,7 @@
resizeProxyVisible: false,
//
isGroup: false,
scrollPosition: 'left',
destroyed: false
scrollPosition: 'left'
};
}
};