Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 2.57 KB

index.md

File metadata and controls

54 lines (40 loc) · 2.57 KB
title group toc
useList 请求表格数据
Hooks
content

useList

何时使用

请求表格数据

示例

API

Props

参数 说明 类型 默认值
fetcher 获取数据请求 (params) => Promise<{ data:T, total: number }> -
initialParams 初始化数据 Record<string, any> -
options 配置项 Options -

Returns

参数 说明 类型 默认值
loading 加载中状态 boolean false
params 请求参数和表格总数 Record<string, any> & { total: number} -
error 错误信息 Error -
data 表格数据 T[] -
mutate 修改 Params 的值 (nextParams, options: MutateOptions) => void -
clear 清空状态,包括数据和参数 () => void -

Options

参数 说明 类型 默认值
immediate 初始化的时候是否获取数据 boolean true

MutateOptions

参数 说明 类型 默认值
revalidate 修改后是否重新请求数据 boolean true
clearData 请求数据前是否清除数据 boolean true