Ben Lin
2024-06-19 f96d4ed77603ca1f908dcdc4a51bd2ce2178d10c
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];
}