fix: table pagination not reactive

pull/4723/head
tangjinzhou 2021-10-01 16:13:24 +08:00
parent 1228e1d604
commit 1add0d251c
1 changed files with 6 additions and 8 deletions

View File

@ -79,6 +79,7 @@ export default function usePagination(
} }
const refreshPagination = (current = 1, pageSize?: number) => { const refreshPagination = (current = 1, pageSize?: number) => {
if (pagination.value === false) return;
setInnerPagination({ setInnerPagination({
current, current,
pageSize: pageSize || mergedPagination.value.pageSize, pageSize: pageSize || mergedPagination.value.pageSize,
@ -93,15 +94,12 @@ export default function usePagination(
onChange(current, pageSize || mergedPagination.value.pageSize); onChange(current, pageSize || mergedPagination.value.pageSize);
}; };
if (pagination.value === false) {
return [computed(() => ({})), () => {}];
}
return [ return [
computed(() => ({ computed(() => {
...mergedPagination.value, return pagination.value === false
onChange: onInternalChange, ? {}
})), : { ...mergedPagination.value, onChange: onInternalChange };
}),
refreshPagination, refreshPagination,
]; ];
} }