Skip to content

Commit 1add0d2

Browse files
committed
fix: table pagination not reactive
1 parent 1228e1d commit 1add0d2

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

components/table/hooks/usePagination.ts

+6-8
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export default function usePagination(
7979
}
8080

8181
const refreshPagination = (current = 1, pageSize?: number) => {
82+
if (pagination.value === false) return;
8283
setInnerPagination({
8384
current,
8485
pageSize: pageSize || mergedPagination.value.pageSize,
@@ -93,15 +94,12 @@ export default function usePagination(
9394
onChange(current, pageSize || mergedPagination.value.pageSize);
9495
};
9596

96-
if (pagination.value === false) {
97-
return [computed(() => ({})), () => {}];
98-
}
99-
10097
return [
101-
computed(() => ({
102-
...mergedPagination.value,
103-
onChange: onInternalChange,
104-
})),
98+
computed(() => {
99+
return pagination.value === false
100+
? {}
101+
: { ...mergedPagination.value, onChange: onInternalChange };
102+
}),
105103
refreshPagination,
106104
];
107105
}

0 commit comments

Comments
 (0)