mirror of
https://github.com/vbenjs/gf-vben-admin.git
synced 2025-02-03 03:32:59 +08:00
feat(table): support asynchrony in beforeFetch and afterFetch (#827)
This commit is contained in:
parent
d38ff6670a
commit
749ba5c1da
@ -203,7 +203,7 @@ export function useDataSource(
|
||||
...(opt?.filterInfo ?? {}),
|
||||
};
|
||||
if (beforeFetch && isFunction(beforeFetch)) {
|
||||
params = beforeFetch(params) || params;
|
||||
params = (await beforeFetch(params)) || params;
|
||||
}
|
||||
|
||||
const res = await api(params);
|
||||
@ -225,7 +225,7 @@ export function useDataSource(
|
||||
}
|
||||
|
||||
if (afterFetch && isFunction(afterFetch)) {
|
||||
resultItems = afterFetch(resultItems) || resultItems;
|
||||
resultItems = (await afterFetch(resultItems)) || resultItems;
|
||||
}
|
||||
dataSourceRef.value = resultItems;
|
||||
setPagination({
|
||||
|
Loading…
Reference in New Issue
Block a user