fix: table pagination not reactive
parent
1228e1d604
commit
1add0d251c
|
@ -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,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue