diff --git a/src/hooks/pagination.ts b/src/hooks/pagination.ts new file mode 100644 index 0000000..97ea2bb --- /dev/null +++ b/src/hooks/pagination.ts @@ -0,0 +1,19 @@ + +export default function usePagination(initValue = false) { + const pagination: any = { + pages: 1, + size: 10, + current: 1, + total: 0, + }; + const setPagination = (value: any) => { + pagination.pages = value.page; + pagination.size = value.size; + pagination.current = value.current; + pagination.total = value.total; + }; + return { + pagination, + setPagination, + }; +} \ No newline at end of file