From 9bc5c1c6481d67782f86d32d424689f9a53a3f06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Tue, 1 Aug 2023 17:39:02 +0800 Subject: [PATCH] fix: close --- components/modal/ModalDialog.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/modal/ModalDialog.vue b/components/modal/ModalDialog.vue index 9d91b755..56e01f3c 100644 --- a/components/modal/ModalDialog.vue +++ b/components/modal/ModalDialog.vue @@ -49,7 +49,7 @@ const props = withDefaults(defineProps(), { const emit = defineEmits<{ /** v-model dialog visibility */ - (event: 'close',): void + (event: 'close'): void }>() const visible = defineModel({ required: true }) @@ -77,6 +77,8 @@ defineExpose({ /** close the dialog */ function close() { + if (!visible.value) + return visible.value = false emit('close') }