mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-29 00:32:44 +08:00
feat(use-loading): add setTip
method
为useLoading添加setTip方法
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
- **Preview** 添加新的属性及事件
|
- **Preview** 添加新的属性及事件
|
||||||
- **Dark Theme** 新增对 tailwindcss 夜间模式的支持
|
- **Dark Theme** 新增对 tailwindcss 夜间模式的支持
|
||||||
|
- **其它** 为 useLoading 添加 setTip 方法
|
||||||
|
|
||||||
### 🐛 Bug Fixes
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
@@ -12,10 +12,12 @@ interface Fn {
|
|||||||
(): void;
|
(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useLoading(props: Partial<LoadingProps>): [Fn, Fn];
|
export function useLoading(props: Partial<LoadingProps>): [Fn, Fn, (string) => void];
|
||||||
export function useLoading(opt: Partial<UseLoadingOptions>): [Fn, Fn];
|
export function useLoading(opt: Partial<UseLoadingOptions>): [Fn, Fn, (string) => void];
|
||||||
|
|
||||||
export function useLoading(opt: Partial<LoadingProps> | Partial<UseLoadingOptions>): [Fn, Fn] {
|
export function useLoading(
|
||||||
|
opt: Partial<LoadingProps> | Partial<UseLoadingOptions>
|
||||||
|
): [Fn, Fn, (string) => void] {
|
||||||
let props: Partial<LoadingProps>;
|
let props: Partial<LoadingProps>;
|
||||||
let target: HTMLElement | Ref<ElRef> = document.body;
|
let target: HTMLElement | Ref<ElRef> = document.body;
|
||||||
|
|
||||||
@@ -39,5 +41,9 @@ export function useLoading(opt: Partial<LoadingProps> | Partial<UseLoadingOption
|
|||||||
instance.close();
|
instance.close();
|
||||||
};
|
};
|
||||||
|
|
||||||
return [open, close];
|
const setTip = (tip: string) => {
|
||||||
|
instance.setTip(tip);
|
||||||
|
};
|
||||||
|
|
||||||
|
return [open, close, setTip];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user