feat: drawer support destroy on close

This commit is contained in:
Netfan
2024-12-30 21:39:00 +08:00
parent e86a7906fe
commit de17007788
3 changed files with 38 additions and 5 deletions

View File

@@ -77,9 +77,11 @@ export function useVbenModal<TParentModalProps extends ModalProps = ModalProps>(
injectData.options?.onOpenChange?.(isOpen);
};
const onClosed = mergedOptions.onClosed;
mergedOptions.onClosed = () => {
options.onClosed?.();
if (options.destroyOnClose) {
onClosed?.();
if (mergedOptions.destroyOnClose) {
injectData.reCreateModal?.();
}
};