更新
This commit is contained in:
@@ -30,9 +30,12 @@ export function usePaging(options: Options) {
|
||||
lists: [] as any[],
|
||||
extend: {} as Record<string, any>
|
||||
})
|
||||
// 请求分页接口
|
||||
const getLists = () => {
|
||||
pager.loading = true
|
||||
// 请求分页接口;silent: true 时不改 loading(用于定时静默刷新,避免表格闪 loading)
|
||||
const getLists = (opts?: { silent?: boolean }) => {
|
||||
const silent = opts?.silent === true
|
||||
if (!silent) {
|
||||
pager.loading = true
|
||||
}
|
||||
return fetchFun({
|
||||
page_no: pager.page,
|
||||
page_size: pager.size,
|
||||
@@ -49,7 +52,9 @@ export function usePaging(options: Options) {
|
||||
return Promise.reject(err)
|
||||
})
|
||||
.finally(() => {
|
||||
pager.loading = false
|
||||
if (!silent) {
|
||||
pager.loading = false
|
||||
}
|
||||
})
|
||||
}
|
||||
// 重置为第一页
|
||||
|
||||
Reference in New Issue
Block a user