UNPKG

@cpany/app

Version:
18 lines (15 loc) 328 B
import Progress from './progress.vue'; import { inject } from 'vue'; import type { Ref } from 'vue'; export { Progress }; export function useGlobalLoading() { const loading = inject<Ref<boolean>>('loading'); return { start() { loading!.value = true; }, end() { loading!.value = false; } }; }