npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bee-pagination

v3.0.7

Published

pagination ui component for react

Downloads

679

Readme

bee-pagination

npm version Build Status Coverage Status

用于内容过多,分页显示内容

Pagination组件内部集成了子组件PaginationButton.PaginationButton并不暴露给用户。

使用

使用单独的bee-Pagination包

组件引入

先进行下载bee-Pagination包

npm install --save bee-pagination

组件调用

import Pagination from 'bee-pagination';
React.render(<div>
   <Pagination
        prev
        next
        first
        last
        ellipsis
        boundaryLinks
        items={20}
        maxButtons={5}
        activePage={this.state.activePage}
        onSelect={this.handleSelect.bind(this)} />
</div>, document.getElementById('target'));

样式引入

  • 可以使用link引入dist目录下bee-pagination.css
<link rel="stylesheet" href="./node_modules/build/Pagination.css">
  • 可以在js中import样式
import "./node_modules/src/Pagination.scss"
//或是
import "./node_modules/build/Pagination.css"

API

|参数|说明|类型|默认值| |:---|:----|:---|:------| |items|总页数|number|1| |activePage|哪一页是激活状态|number|1| |onSelect|切换页的方法|func |() => {}| |maxButtons|显示最多页数按钮|number|0| |prev|显示上一页按钮|bool|false| |next|显示下一页按钮|bool|false| |first|显示第一页按钮|bool|false| |last|显示最后一页按钮|bool|last| |ellipsis|显示省略按钮|bool|false| |boundaryLinks|显示边界按钮|bool|false| |gap|按钮之间有间隔|bool|true| |noBorder|不显示按钮边框|bool|false| |size|分页按钮大小(lg md sm)|string|'sm'| |showJump|是否显示跳页选择|bool|false(为了兼容老版本)| |onDataNumSelect|选择每页多少条的回调函数|func|() => {}| |dataNumSelect|每页多少条的下拉选择Option内容|array|['5','10','15','20']| |dataNum|下拉选择的设定值的index|num|1| |total|一共多少条|num|1| |disabled|pagination不可用,不可点击|bool|false| |confirmBtn|渲染确认按钮dom的方法|func|() => {}|

开发调试

$ git clone https://github.com/tinper-bee/bee-pagination
$ cd bee-pagination
$ npm install
$ npm run dev