diff --git a/src/components/Modal/src/hooks/useModal.ts b/src/components/Modal/src/hooks/useModal.ts index 25384d18..728564f9 100644 --- a/src/components/Modal/src/hooks/useModal.ts +++ b/src/components/Modal/src/hooks/useModal.ts @@ -90,6 +90,10 @@ export function useModal(): UseModalReturnType { dataTransferRef[unref(uidRef)] = toRaw(data); } }, + + closeModal: () => { + getInstance()?.setModalProps({ visible: false }); + }, }; return [register, methods]; } diff --git a/src/components/Modal/src/types.ts b/src/components/Modal/src/types.ts index 55e4f6ef..71aa9ae9 100644 --- a/src/components/Modal/src/types.ts +++ b/src/components/Modal/src/types.ts @@ -13,6 +13,7 @@ export type RegisterFn = (modalMethods: ModalMethods, uuid?: string) => void; export interface ReturnMethods extends ModalMethods { openModal: (props?: boolean, data?: T, openOnSet?: boolean) => void; + closeModal: () => void; getVisible?: ComputedRef; }