This article mainly introduces react. js flip plug-in instance code information, very good, has reference value, you can refer to the need of friends not to talk about nonsense, below to share with you react. the code of the js flip plug-in is as follows:
VarPage = React. createClass ({render: function () {// The intermediate code updates vartotalRows = this. props. totalRows; varlistRows = this. props. listRows; varnowPage = this. props. nowPage> 0? This. props. nowPage: 1; varfirstRow = this. props. listRows * (this. props. nowPage-1); vartotalPage = Math. ceil (totalRows/listRows); varshow_count = this. props. show_count? This. props. show_count: 5; if ((! TotalPage) & nowPage> totalPage) {this. props. nowPage = totalPage;} if (this. props. nowPage <1) {this. props. nowPage = 1;} varshow_count_mid = show_count/2; varpages = []; for (vari = 1; I <= show_count; I ++) {varpage = 0; if (nowPage <= show_count_mid) {page = I;} else if (nowPage + show_count_mid> totalPage) {page = totalPage-show_count + I;} else {page = nowPage-Math.ceil (show_count_mid) + I;} if (page> 0 & page! = NowPage) {if (page <= totalPage) {pages. push (
{Page}) ;}} Else {pages. push (
{Page}) ;}} This. pagesbutton = pages; return (this. props. totalRows> 0? (
Total: {this. props. totalRows} {this. props. nowPage}/{Math. ceil (this. props. totalRows/this. props. listRows )}
Firstpage
«{This. pagesbutton}
»
Lastpage):(
No data));}});
The above is the react. js paging plug-in instance Code introduced by xiaobian. I hope it will help you. If you have any questions, please leave a message and I will reply to you in a timely manner. I would like to thank you for your support for PHP chinnet!
For more articles about react. js flip plug-in instance code, please follow the PHP Chinese network!