gd-lib
v3.3.21
Published
- [useList](#gear-uselist) - [useRecord](#gear-userecord) - [useScrollList](#gear-usescrolllist) - [useTable](#gear-usetable) - [delay](#gear-delay) - [getMyUnoCssPreset](#gear-getmyunocsspreset)
Downloads
16
Readme
:toolbox: Functions
:gear: useList
列表
| Function | Type |
| ---------- | ---------- |
| useList
| ({ request, response, initSearchForm, isAuto }: Option) => { setList: (searchForm?: AnyObject) => Promise<void>; list: Ref<any[]>; searchForm: Ref<any>; isLoading: Ref<boolean>; isEmpty: Ref<boolean>; state: { ...; }; }
|
Parameters:
option.request
: 请求数据option.response
: 处理响应数据option.initSearchForm
: 初始的查询条件option.isAuto
: onMounted时自动请求数据
:gear: useRecord
一条记录
| Function | Type |
| ---------- | ---------- |
| useRecord
| ({ request, response, initSearchForm, isAuto }: Option) => { setRecord: (searchForm?: AnyObject) => Promise<void>; record: Ref<any>; searchForm: Ref<any>; isLoading: Ref<boolean>; state: { record: any; searchForm: any; isLoading: boolean; }; }
|
:gear: useScrollList
滚动列表
| Function | Type |
| ---------- | ---------- |
| useScrollList
| ({ request, response, initSearchForm, pageSize, isAuto, onReachBottom, onPullDownRefresh }: Option) => { setList: (isSearch?: boolean) => Promise<void>; search: () => Promise<void>; next: () => Promise<void>; reset: () => Promise<void>; ... 8 more ...; state: { ...; }; }
|
:gear: useTable
表格
| Function | Type |
| ---------- | ---------- |
| useTable
| ({ request, response, initSearchForm, pageSize, isAuto }: Option) => { setList: (searchForm?: AnyObject) => Promise<void>; search: (searchForm?: AnyObject) => Promise<void>; reset: (searchForm?: AnyObject) => Promise<void>; pageNum: Ref<...>; ... 7 more ...; state: { ...; }; }
|
:gear: delay
延迟
| Function | Type |
| ---------- | ---------- |
| delay
| (millisecond?: number) => Promise<unknown>
|
Parameters:
millisecond
: - 毫秒
:gear: getMyUnoCssPreset
uno.css的preset
| Function | Type |
| ---------- | ---------- |
| getMyUnoCssPreset
| (option?: Option) => { name: string; prefix: string; rules: ((RegExp or (([_, num]: any[]) => { margin: string; }))[] | (RegExp | (([_, num]: any[]) => { 'margin-top': string; }))[] | (RegExp | (([_, num]: any[]) => { ...; }))[] | ... 19 more ... | (RegExp | (([_, num]: any[]) => { ...; }))[])[]; }
|