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