src/components/Loading/src/useLoading.ts
@@ -1,7 +1,8 @@ import type { Ref } from 'vue'; import { unref } from 'vue'; import { tryOnUnmounted } from '@vueuse/core'; import { createLoading } from './createLoading'; import type { LoadingProps } from './typing'; import type { Ref } from 'vue'; export interface UseLoadingOptions { target?: any; @@ -45,5 +46,9 @@ instance.setTip(tip); }; tryOnUnmounted(() => { instance.destroy(); }); return [open, close, setTip]; }