You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
1.0 KiB
21 lines
1.0 KiB
import {PageProps} from "./entity";
|
|
import React from "react";
|
|
import {Pagination} from "react-bootstrap";
|
|
|
|
/**
|
|
* 分页组件
|
|
*/
|
|
export class Page extends React.Component<PageProps, { undefined?:undefined }>{
|
|
|
|
render() {
|
|
return (
|
|
<Pagination className="justify-content-center">
|
|
{this.props.currentPage===1?<Pagination.First disabled/>:<Pagination.First onClick={()=>this.props.onClick(1)}/>}
|
|
{this.props.currentPage>1?<Pagination.Prev onClick={()=>this.props.onClick(this.props.currentPage-1)}/>:<Pagination.Prev disabled/>}
|
|
<Pagination.Item active>{this.props.currentPage}</Pagination.Item>
|
|
{this.props.currentPage<this.props.totalPage?<Pagination.Next onClick={()=>this.props.onClick(this.props.currentPage+1)}/>:<Pagination.Next disabled/>}
|
|
{this.props.currentPage===this.props.totalPage?<Pagination.Last disabled/>:<Pagination.Last onClick={()=>this.props.onClick(this.props.totalPage)}/>}
|
|
</Pagination>
|
|
);
|
|
}
|
|
}
|
|
|