diff --git a/packages/components/dialog/src/dialogContentModal.ts b/packages/components/dialog/src/dialogContentModal.ts index 5d7eacb65..662e74010 100644 --- a/packages/components/dialog/src/dialogContentModal.ts +++ b/packages/components/dialog/src/dialogContentModal.ts @@ -1,4 +1,4 @@ -import { defineComponent, h, mergeProps, onUnmounted, ref } from 'vue' +import { defineComponent, h, mergeProps, onBeforeUnmount, ref } from 'vue' import { primitiveProps, propsOmit } from '@oku-ui/primitive' import { useComposedRefs, useForwardRef } from '@oku-ui/use-composable' import { composeEventHandlers } from '@oku-ui/utils' @@ -43,10 +43,10 @@ const dialogContentModal = defineComponent({ const isRightClickOutsideRef = ref(false) - onUnmounted(() => { + onBeforeUnmount(() => { const content = contentRef.value if (content) - return hideOthers(content) + hideOthers(content) }) return () => h(OkuDialogContentImpl, {