From 28ff1d9c714ff2d6c48dbb80fbc9781a1f76fd76 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Wed, 28 Sep 2022 23:06:46 +0800 Subject: [PATCH] fix(nc-gui): init after props.type is changed --- packages/nc-gui/components/dlg/ViewCreate.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/components/dlg/ViewCreate.vue b/packages/nc-gui/components/dlg/ViewCreate.vue index 26c5b05b4e..173f100fd2 100644 --- a/packages/nc-gui/components/dlg/ViewCreate.vue +++ b/packages/nc-gui/components/dlg/ViewCreate.vue @@ -99,11 +99,12 @@ const typeAlias = computed( }[props.type]), ) -watch(vModel, (value) => value && init()) - watch( () => props.type, - (newType) => (form.type = newType), + (newType) => { + form.type = newType + init() + }, ) function init() {