init: 初始系统模板

This commit is contained in:
TsMask
2023-09-05 14:38:23 +08:00
parent a5bc16ae4f
commit 1075c8ae4f
130 changed files with 22531 additions and 1 deletions

16
src/hooks/useLoading.ts Normal file
View File

@@ -0,0 +1,16 @@
import { ref, inject, provide } from 'vue';
const INJECT_LOADING_KEY = Symbol('loading_store');
export const createLoading = (v = false) => {
const loading = ref<boolean>(v);
const change = (bool: boolean) => {
loading.value = bool;
};
provide(INJECT_LOADING_KEY, loading);
return [loading, change];
};
export const useLoading = () => {
return inject(INJECT_LOADING_KEY);
};