# @beisen-cmps/paging

> 平台分页组件

Latest version **0.1.50** (published 2018-10-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install @beisen-cmps/paging
pnpm add @beisen-cmps/paging
yarn add @beisen-cmps/paging
bun add @beisen-cmps/paging
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.50 |
| Published | 2018-10-09 |
| First published | 2018-04-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 27.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | beisen |
| Maintainers | beisencorp |
| Keywords | beisen, react-component, es6 |

## Links

- npm: https://www.npmjs.com/package/@beisen-cmps/paging
- npm.io page: https://npm.io/package/@beisen-cmps/paging

## Dependencies (5)

- [commitizen](https://npm.io/package/commitizen.md) ^2.10.1
- [cz-customizable](https://npm.io/package/cz-customizable.md) ^5.2.0
- [@beisen-cmps/common-func](https://npm.io/package/@beisen-cmps/common-func.md)
- [@beisen-cmps/react-icons](https://npm.io/package/@beisen-cmps/react-icons.md)
- [@beisen-cmps/dropdown-button](https://npm.io/package/@beisen-cmps/dropdown-button.md)

## Recent versions

- 0.1.50 (latest) — 2018-10-09
- 1.0.11 — 2018-06-19
- 1.0.1 — 2018-06-19
- 0.0.10 — 2018-05-16
- 0.0.9 — 2018-05-14
- 0.0.8 — 2018-05-13
- 0.0.7 — 2018-05-13
- 0.0.6 — 2018-05-11
- 0.0.4 — 2018-05-08
- 0.0.3 — 2018-05-07
- 0.0.2 — 2018-05-07
- 0.0.1 — 2018-04-26

## README

# paging

## 参数

### props
```javascript
const props = {
  hidden: false,    // 是否渲染 默认false
  total: 20,        // 总页数
  currentPage: 1,   // 当前页数
  visiblePages: 9,  // 显示的页数 min = 5
  capacity: 10,     // 每页条数，页面容量
  capacityList: [15, 30, 60, 100], //可选的页面容量
  isShowDropdown: true,
  autoDirection:false,  //DropDownButton的autoDirection属性
  direction:false,      //DropDownButton的direction属性
  hasJumpTo:false,      //是否显示跳转至
  onIndexChange: index => console.log(index),     // 页数变化
  onCapacityChange: index => console.log(index),  //页面容量变化
  focusCallBack: event => console.log(event),     // input 
  blurCallBack: event => console.log(event),      // input
  changeCallBack: event => console.log(event)     // input
}
```

### PropTypes
```javascript
Paging.propTypes = {
  hidden: PropTypes.bool,
  total: PropTypes.number.isRequired,
  currentPage: PropTypes.number.isRequired,
  visiblePages: PropTypes.number.isRequired,
  capacity: PropTypes.number.isRequired,
  capacityList: PropTypes.array.isRequired,
  onIndexChange: PropTypes.func.isRequired,
  onCapacityChange: PropTypes.func.isRequired
}
```

## 使用方法

1.安装npm组件包

```
npm install @beisen/paging --save-dev
```

2.引用组件

  ```javascript
import Paging from "@beisen/paging"
  ```
  
3.传入参数

  该参数为上述参数，传入方式使用: {...参数}

```javascript

class Paging extends Component {
  render() {
      const options = {
        hidden: false, // 是否渲染 默认false
        total: 20, //总页数
        currentPage: 1, // 当前页数
        visiblePages: 9, // 显示的页数 min = 5
        capacity: 10, // 每页条数，页面容量
        capacityList:[15,30,60,100],//可选的页面容量
        onIndexChange: index => console.log(index), // 页数变化
        onCapacityChange: index => console.log(index)  //页面容量变化
      };
      return <Paging {...options} />
  }
}

React.render(<Paging />, document.getElementById('content'))

```

---
_Source: https://npm.io/package/@beisen-cmps/paging · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
