1.0.6 • Published 6 years ago

react-page-toggle-qys v1.0.6

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

react-page-toggle-qys npm

install

  npm install --save react-page-toggle-qys

  // in code ES6
  import pageToggle from 'react-page-toggle-qys';
  // or commonjs
  var pageToggle = require('react-page-toggle-qys');

using

<PageToggle
    // the loadData has a param, it is startIndex and that value is 0
    loadData={loadData}
    length={length}
    currentPage={currentPage}
    hasMoreItems={hasMoreItems}
    style={{..}} 
    contentSty={{..}} 
    // default value is 20%
    headerHeight={"20% | 20px"} 
    // below props only if you need config your title style
    title={<div style={{..}}>..</div>}
    // below props only if you need config your btn style, it is not necessary, it has default style
    homeBtn={<div style={{..}}>..</div>}
    prevBtn={<div style={{..}}>..</div>}
    nextBtn={<div style={{..}}>..</div>}
 >
  {items}
</PageToggle>

props

nametypedescription
loadDatafunctiona function which must be called after triggering the button. It must trigger some sort of action which fetches the next data and the startIndex which the only param of the function, and it is default must be 0
hasMoreItemsbooleanit tells the PageToggle component on whether to call next function on reaching the bottom and shows an endMessage to the user
lengthnumberset the length of the data.This will unlock the subsequent calls to next.
currentPagenumbercurrentPage
styleobjectany style which you want to override
titleobjectany style which you want to show the title,
headerHeightstringset the height of your header default header height is 20%,
contentStyobjectany style which you want to show the content style, default height is 80%
homeBtnobjectany style which you want to show the homeBtn, default={<i className="iconfont icon-zhuye" style={zySty}/>}
prevBtnobjectany style which you want to show the prevBtn, default={<i className="iconfont icon-icon-test1" style={preSty}/>}
nextBtnobjectany style which you want to show the nextBtn, default={<i className="iconfont icon-icon-test2" style={nextSty}/>}
1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago