perf: table filter perf

pull/2295/head^2
shudingbo 2020-05-24 22:31:09 +08:00 committed by GitHub
parent 59da3e54e3
commit 9e88a997c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -157,6 +157,7 @@ export default {
sPagination: this.getDefaultPagination(this.$props), sPagination: this.getDefaultPagination(this.$props),
pivot: undefined, pivot: undefined,
sComponents: createComponents(this.components), sComponents: createComponents(this.components),
filterDataCnt: 0
}; };
}, },
watch: { watch: {
@ -375,6 +376,7 @@ export default {
getCurrentPageData() { getCurrentPageData() {
let data = this.getLocalData(); let data = this.getLocalData();
this.filterDataCnt = data.length;
let current; let current;
let pageSize; let pageSize;
const sPagination = this.sPagination; const sPagination = this.sPagination;
@ -934,7 +936,7 @@ export default {
size = 'small'; size = 'small';
} }
const position = pagination.position || 'bottom'; const position = pagination.position || 'bottom';
const total = pagination.total || this.getLocalData().length; const total = pagination.total || this.filterDataCnt;
const { class: cls, style, onChange, onShowSizeChange, ...restProps } = pagination; // eslint-disable-line const { class: cls, style, onChange, onShowSizeChange, ...restProps } = pagination; // eslint-disable-line
const paginationProps = mergeProps({ const paginationProps = mergeProps({
key: `pagination-${paginationPosition}`, key: `pagination-${paginationPosition}`,