react-infinite-loading 基于浏览器的 React 无限滚动插件开源项目

我要开发同款
匿名用户2017年11月23日
47阅读
开发技术JavaScript
所属分类网页组件、Web应用开发、UI组件库
授权协议MIT

作品详情

react-infinite-loading

基于浏览器的React无限滚动插件

安装

react-infinite-loading要求React15或更高版本

install --save-dev react-infinite-loading

使用

import Infinite from 'react-infinite-loading';<Infinite handleLoading={this.handleLoading} loading={this.state.loading}>  {/* scrolled element */}</Infinite>

参数

一些控制参数,用在组件的属性中

Infinite.propTypes = {  // control the current status. loading = true the animation is displayed and no longer triggers handleLoading event  loading: PropTypes.bool,  // whether to display the loading animation  isLoading: PropTypes.bool,  // load animation components  asLoading: PropTypes.node,  // if true, scroll range as a current component on the contrary scroll range as a window  elementScroll: PropTypes.bool,  // set the height of the scroll container, scrollHeight={300} or scrollHeight="calc(100% - 100px)"  scrollHeight: PropTypes.any.isRequired,  // trigger handleLoading event threshold  scrollThreshold: PropTypes.num,  // scroll to the bottom event  handleLoading: PropTypes.func,  // sisplayed content  children: PropTypes.node}
查看全文
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论