react-ifiite-loadig
基于浏览器的React无限滚动插件
安装
react-ifiite-loadig要求React15或更高版本
istall --save-dev react-ifiite-loadig使用
import Ifiite from 'react-ifiite-loadig';<Ifiite hadleLoadig={this.hadleLoadig} loadig={this.state.loadig}> {/* scrolled elemet */}</Ifiite>参数
一些控制参数,用在组件的属性中
Ifiite.propTypes = { // cotrol the curret status. loadig = true the aimatio is displayed ad o loger triggers hadleLoadig evet loadig: PropTypes.bool, // whether to display the loadig aimatio isLoadig: PropTypes.bool, // load aimatio compoets asLoadig: PropTypes.ode, // if true, scroll rage as a curret compoet o the cotrary scroll rage as a widow elemetScroll: PropTypes.bool, // set the height of the scroll cotaier, scrollHeight={300} or scrollHeight="calc(100% - 100px)" scrollHeight: PropTypes.ay.isRequired, // trigger hadleLoadig evet threshold scrollThreshold: PropTypes.um, // scroll to the bottom evet hadleLoadig: PropTypes.fuc, // sisplayed cotet childre: PropTypes.ode}
评论