2.0.2 • Published 8 years ago

react-pagers v2.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

react-pagers

Paginator for React.JS

安装

$ npm install react-pagers --save

请根据自己的需要导入相应的样式,样式代码源自于 bootstrap 框架。

require('react-pagers/dist/stylesheet/react-pagers-pagination.css');

// or

require('react-pagers/dist/stylesheet/react-pagers-pager.css');

使用

import ReactPagers from 'ReactPagers';

<ReactPagers {...props} />

API

名称类型默认值描述
totalnumber1一共有多少页
activenumber1当前页面
numbernumber9显示多少个页码
useHashbooleantrue是否启用hash
visiablebooleantrue页码是否可见
languageobjectlanguage: { last: 'Last', prev: '«', next: '»', first: 'First' }本地化
onChangefunctionnull改变页码时的回调函数
classNameobjectclassName: { prev: null, next: null, last: null, first: null, container: null }样式自定义
jumperbooleanfalse是否显示跳转输入框

如果开启了useHash,每次的翻页都会在hash中记载,如需实现页面内容根据hash中page字段,需手动获取page字段并传入,如:

var matcher = /page\=([0-9]+)/,
    result  = location.hash.match(matcher),
    active  = 1;

if ($.isArray(result)) {
  active = +result.pop();
}

// ...

更新日志

  • v2.0.2

    • useHash bug 修复
  • v2.0.1

    • 样式整理
  • v2.0.0

    • 新增功能:jumper 是否显示跳转输入框
  • v1.0.2

    • 新增功能:useHash
  • v1.0.1

    • 逻辑错误
  • v1.0.0

    • 基本功能
    • 本地化
    • 自定义样式

License

MIT

2.0.2

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago