Skip to content

Commit 9e88a99

Browse files
authored
perf: table filter perf
1 parent 59da3e5 commit 9e88a99

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/table/Table.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ export default {
157157
sPagination: this.getDefaultPagination(this.$props),
158158
pivot: undefined,
159159
sComponents: createComponents(this.components),
160+
filterDataCnt: 0
160161
};
161162
},
162163
watch: {
@@ -375,6 +376,7 @@ export default {
375376

376377
getCurrentPageData() {
377378
let data = this.getLocalData();
379+
this.filterDataCnt = data.length;
378380
let current;
379381
let pageSize;
380382
const sPagination = this.sPagination;
@@ -934,7 +936,7 @@ export default {
934936
size = 'small';
935937
}
936938
const position = pagination.position || 'bottom';
937-
const total = pagination.total || this.getLocalData().length;
939+
const total = pagination.total || this.filterDataCnt;
938940
const { class: cls, style, onChange, onShowSizeChange, ...restProps } = pagination; // eslint-disable-line
939941
const paginationProps = mergeProps({
940942
key: `pagination-${paginationPosition}`,

0 commit comments

Comments
 (0)