rp

reactjs-pagination

reactjs-pagination是一个react的本地分页组件,支持页码、跳转、和迷你模式。

Showing:

Popularity

Downloads/wk

7

GitHub Stars

8

Maintenance

Last Commit

5yrs ago

Contributors

1

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

reactjs-pagination

一个react的本地分页组件

version MIT License

reactjs-pagination是一个react的本地分页组件,支持页码、跳转、和迷你模式。

使用

npm install --save reactjs-pagination
import React, { Component } from 'react';
import { Pagination }from 'reactjs-pagination';

class Test extends Component {
    state = {
        totalNumber: 326,
        pageSize: 10,
        currentPage: 31
    };
    constructor(props) {
        super(props);
        setTimeout(() => {
            // this.setState({
            //  currentPage: 15
            // });
            this.setState({
                totalNumber: 125
            });
        }, 3000);
    }
    handleChange = (idx) => {
        console.log('页码改变 => ', idx);
    }
    render() {
        const { totalNumber, pageSize, currentPage } = this.state;

        return (
            <div>
                <Pagination
                    totalNumber={totalNumber}
                    pageSize={pageSize}
                    currentPage={currentPage}
                    middlePage={5}
                    onChange={this.handleChange}
                    showPages
                    showGo
                />
            </div>
        )
    }
}

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100