1.0.70 • Published 3 years ago

@nuonuonuonuoyan/react-infinite-scroll v1.0.70

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

示例查看 http://qinwang.battlebanpick.com/infinite

安装

yarn add @nuonuonuonuoyan/react-infinite-scrollnpm i @nuonuonuonuoyan/react-infinite-scroll

import InfiniteScroll from '@nuonuonuonuoyan/react-infinite-scroll'

API

属性说明类型默认值
scrollWrapperClass列表容器的样式类string-
dataSource列表数据array[]
renderListItem渲染每一行的数据(item,index) => ReactNode-
service发起请求的接口() => Promise-
defaultParams发起自动请求时的默认参数object{}
onLoad首次加载的回调(res) => void-
mountLoadElement自定义首次加载提示内容ReactNode-
mountLoadClass首次加载的样式类(配合 mountLoadText 使用)string-
mountLoadText首次加载的提示文案string首次加载...
manual是否默认请求一次接口,如果设置为 true,则不会默认请求接口booleanfalse
canFirstLoad是否可以进行首次加载,需要配合 manual=true 使用booleanfalse
onSuccess加载成功的回调(res) => void-
onError加载失败的回调(res) => void-
onFinally不论成功失败都最终执行的回调(res) => void-
onLoadMore加载更多的回调async () => void-
loadMoreParams加载更多时上送给接口的参数object{}
requestParams是否默认请求一次接口,如果设置为 true,则不会默认请求接口booleanfalse
canFirstLoad是否可以进行首次加载,需要配合 manual=true 使用booleanfalse
loadMoreText加载更多时的文案展示string \| ReactNode正在全力加载...
loadMoreElement自定义加载更多ReactNode-
loadMoreClass加载更多的样式类(配合 loadMoreText 使用)string-
hasMore是否还有更多内容booleantrue
noMoreElement自定义无更多内容ReactNode-
noMoreText无更多内容的文案(res) => void没有更多数据了
noMoreClass无更多内容的样式类(配合 noMoreText 使用)string-
threshold触发加载事件的滚动触底距离阈值number50
isEmpty是否为空列表booleanfalse
emptyText空列表展示的文案string-
emptyTextClass空列表的样式类(配合 emptyText 使用)string-
emptyElement自定义空列表ReactNode-

requestParams

更多参数请移步 useRequest W

1.0.70

3 years ago

1.0.62

3 years ago

1.0.61

3 years ago

1.0.59

3 years ago

1.0.69

3 years ago

1.0.58

3 years ago

1.0.43

3 years ago

1.0.41

3 years ago

1.0.40

3 years ago

1.0.39

3 years ago

1.0.38

3 years ago

1.0.35

3 years ago

1.0.34

3 years ago

1.0.31

3 years ago