mirror of
https://github.com/vbenjs/gf-vben-admin.git
synced 2025-01-24 04:10:20 +08:00
feat(modal): add closeModal for useModal
This commit is contained in:
parent
21f7a854fe
commit
6d5f9aa699
@ -90,6 +90,10 @@ export function useModal(): UseModalReturnType {
|
|||||||
dataTransferRef[unref(uidRef)] = toRaw(data);
|
dataTransferRef[unref(uidRef)] = toRaw(data);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
closeModal: () => {
|
||||||
|
getInstance()?.setModalProps({ visible: false });
|
||||||
|
},
|
||||||
};
|
};
|
||||||
return [register, methods];
|
return [register, methods];
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ export type RegisterFn = (modalMethods: ModalMethods, uuid?: string) => void;
|
|||||||
|
|
||||||
export interface ReturnMethods extends ModalMethods {
|
export interface ReturnMethods extends ModalMethods {
|
||||||
openModal: <T = any>(props?: boolean, data?: T, openOnSet?: boolean) => void;
|
openModal: <T = any>(props?: boolean, data?: T, openOnSet?: boolean) => void;
|
||||||
|
closeModal: () => void;
|
||||||
getVisible?: ComputedRef<boolean>;
|
getVisible?: ComputedRef<boolean>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user