React. js flip plug-in instance code

Source: Internet
Author: User
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!

    Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.