rpaging
v0.0.5
Published
react pagination
Downloads
6
Readme
rpaging
一款简洁的 react 分页组件
Install
npm install rpaging --save
Example
import React,{ Component } from "react";
import Pagination from "rpaging";
class App extends Component{
async componentDidMount(){
await setTimeout(()=>{
new Promise((res)=>{
this.setState({
renderPage:true
})
})
},2000);
}
render(){
let Page = this.state.renderPage?(
<Pagination config = {{
async paging(pageObj){
let data = await fetch(URL).then((res)=>res.json());
}
}}
></Pagination>
):"";
return(
<div>
{ Page }
</div>
);
}
}
Tips
This component uses CSS MODULES,ensure you have opened CSS MODULES before you use it.