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 });