@aligov/use-pull-reload

这个组件的功能是 balabala

Usage no npm install needed!

<script type="module">
  import aligovUsePullReload from 'https://cdn.skypack.dev/@aligov/use-pull-reload';
</script>

README

rax-example

Install

$ npm install @aligov/use-pull-reload --save

Usage

用法与 g 端 UseFormTableHooks 相似,主要用于下拉刷新

API

Props

loading data page onEnd search, reload, changePage, increasePage, updateData, updatePageSize, readyToSearch, stopSearch, forceUpdate

Function

name param return describe
loading boolean / 刷新状态(初始化和搜索会触发 loading,分页不会)
data Object / 请求结果
page number / 当前页数
onEnd boolean / 是否到达底部(需要保证 pageSize 大于屏幕一页可展示区域)
search function / 搜索
reload function / 刷新
changePage function / 分页
increasePage function / 下一页
updateData function / 更新数据
updatePageSize function / 更新 pageSize
readyToSearch function / 开始请求
stopSearch function / 停止请求
forceUpdate function / 强制重新刷新数据

Example

见 demo