fix: the onOpenChange event for the modal component does not work as expected (#4425)

pull/48/MERGE
Vben 2024-09-18 22:44:46 +08:00 committed by GitHub
parent 2c22825546
commit 834cb4c470
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 8 deletions

View File

@ -112,6 +112,7 @@ function createCssOptions(injectGlobalScss = true) {
} }
return content; return content;
}, },
api: 'modern-compiler',
}, },
} }
: {}, : {},

View File

@ -54,10 +54,10 @@ export function useVbenDrawer<
...options, ...options,
} as DrawerApiOptions; } as DrawerApiOptions;
// mergedOptions.onOpenChange = (isOpen: boolean) => { mergedOptions.onOpenChange = (isOpen: boolean) => {
// options.onOpenChange?.(isOpen); options.onOpenChange?.(isOpen);
// injectData.options?.onOpenChange?.(isOpen); injectData.options?.onOpenChange?.(isOpen);
// }; };
const api = new DrawerApi(mergedOptions); const api = new DrawerApi(mergedOptions);
const extendedApi: ExtendedDrawerApi = api as never; const extendedApi: ExtendedDrawerApi = api as never;

View File

@ -58,10 +58,10 @@ export function useVbenModal<TParentModalProps extends ModalProps = ModalProps>(
...options, ...options,
} as ModalApiOptions; } as ModalApiOptions;
// mergedOptions.onOpenChange = (isOpen: boolean) => { mergedOptions.onOpenChange = (isOpen: boolean) => {
// options.onOpenChange?.(isOpen); options.onOpenChange?.(isOpen);
// injectData.options?.onOpenChange?.(isOpen); injectData.options?.onOpenChange?.(isOpen);
// }; };
const api = new ModalApi(mergedOptions); const api = new ModalApi(mergedOptions);
const extendedApi: ExtendedModalApi = api as never; const extendedApi: ExtendedModalApi = api as never;