mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-02-16 19:22:27 +08:00
fix Bug or esLink formatting
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import { Ref, isReactive, isRef } from 'vue'
|
||||
import { isReactive, isRef } from 'vue';
|
||||
|
||||
function setLoading(loading, val) {
|
||||
if (loading != undefined && isRef(loading)) {
|
||||
loading.value = val
|
||||
} else if (loading != undefined && isReactive(loading)) {
|
||||
loading.loading = val
|
||||
}
|
||||
if (loading != undefined && isRef(loading)) {
|
||||
loading.value = val;
|
||||
} else if (loading != undefined && isReactive(loading)) {
|
||||
loading.loading = val;
|
||||
}
|
||||
}
|
||||
|
||||
export const useAsync = async (func: Promise<any>, loading: any): Promise<any> => {
|
||||
setLoading(loading, true)
|
||||
setLoading(loading, true);
|
||||
|
||||
return await func.finally(() => setLoading(loading, false))
|
||||
}
|
||||
return await func.finally(() => setLoading(loading, false));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user