From 428328c29b40e1d5d8dc7b7bd9768571c1f5390d Mon Sep 17 00:00:00 2001 From: CzBiX Date: Mon, 30 Mar 2020 12:19:45 +0800 Subject: [PATCH] Minor fix --- src/components/GlobalDialog.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/GlobalDialog.vue b/src/components/GlobalDialog.vue index af2640b..511a0b9 100644 --- a/src/components/GlobalDialog.vue +++ b/src/components/GlobalDialog.vue @@ -75,7 +75,7 @@ export default { if (!userConfig.value) { return null; } - return Object.assign(DefaultConfig, userConfig.value) as DialogConfig; + return Object.assign({}, DefaultConfig, userConfig.value) as DialogConfig; }); const content = computed(() => (config.value ? config.value.content : null)); const value = ref(); @@ -102,14 +102,15 @@ export default { watch(config, (v) => { value.value = !!v; + if (!v) { + input.value = undefined + } }); - watch(value, async (v) => { + watch(value, (v) => { if (v || !config.value) { return } - input.value = undefined; - clickBtn(null); }, { lazy: true });