# @gaopeng123/hooks.use-pagination

> 分页器

Latest version **0.7.10-alpha.0** (published 2024-05-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @gaopeng123/hooks.use-pagination
pnpm add @gaopeng123/hooks.use-pagination
yarn add @gaopeng123/hooks.use-pagination
bun add @gaopeng123/hooks.use-pagination
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.7.10-alpha.0 |
| Published | 2024-05-23 |
| First published | 2022-09-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | ligaopeng123 |
| Maintainers | gaopeng123 |
| Keywords | pagination |

## Links

- npm: https://www.npmjs.com/package/@gaopeng123/hooks.use-pagination
- Repository: https://github.com/ligaopeng123-npm/hooks
- Homepage: https://github.com/ligaopeng123-npm/hooks#readme
- Issues: https://github.com/ligaopeng123-npm/hooks/issues
- npm.io page: https://npm.io/package/@gaopeng123/hooks.use-pagination

## Recent versions

- 0.7.10-alpha.0 (latest) — 2024-05-23
- 0.7.8 — 2024-02-01
- 0.7.6 — 2023-09-19
- 0.7.2 — 2023-08-10
- 0.7.1 — 2023-08-02
- 0.6.3 — 2023-08-02
- 0.6.0 — 2023-05-11
- 0.5.1 — 2023-01-06
- 0.5.0 — 2022-09-29
- 0.4.2 — 2022-09-12
- 0.4.0 — 2022-09-09
- 0.3.10 — 2022-09-09
- 0.3.9 — 2022-09-09

## README

# `usePagination`

> TODO: 分页hooks
>
> [在线demo](https://ligaopeng123-npm.github.io/hooks/?path=/story/example-usepagination--demo)

## Usage

```tsx
import React from 'react';
import { usePagination } from "@gaopeng123/hooks.use-pagination";

type TestUsePaginationProps = {};
const TestUsePagination: React.FC<TestUsePaginationProps> = (props) => {
    const [current, next, last] = usePagination({pageNum: 1, pageSize: 10, total: 301});
    return (
        <div style={{backgroundColor: '#97fa04', width: '100%', height: '100%'}}>
            <h3>usePagination</h3>
            <a onClick={() => next()}>下一页</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a onClick={() => last()}>上一页</a><br/>
            current: {
                current
            }
        </div>
    )
};

export default TestUsePagination;
```

---
_Source: https://npm.io/package/@gaopeng123/hooks.use-pagination · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
