Ben Lin
2024-07-04 5fdea06fbfc49a8ae8f20054db6b27fcf4ade75f
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];
}