From 0640e1f594c02d0d1797d0b0c5013130e21947a2 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Tue, 2 Aug 2022 21:28:50 +0530 Subject: [PATCH] fix/gui-v2-json-bug-fix --- packages/nc-gui-v2/components/cell/Json.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/nc-gui-v2/components/cell/Json.vue b/packages/nc-gui-v2/components/cell/Json.vue index 17b64deea7..d9f48dba69 100644 --- a/packages/nc-gui-v2/components/cell/Json.vue +++ b/packages/nc-gui-v2/components/cell/Json.vue @@ -7,7 +7,7 @@ import { inject, onMounted } from '#imports' import { EditModeInj } from '~/context' interface Props { - modelValue: string + modelValue: string | Record | undefined } interface Emits { @@ -31,16 +31,17 @@ const clear = () => { isExpanded = false editEnabled = false - localValue = vModel + localValue = JSON.stringify(vModel) } const onSave = () => { - vModel = localValue isExpanded = false + vModel = localValue } onMounted(() => { - localValue = vModel + console.log('mount', vModel) + localValue = JSON.stringify(vModel) }) watch( @@ -59,7 +60,7 @@ watch( () => editEnabled, () => { isExpanded = false - localValue = vModel + localValue = JSON.stringify(vModel) }, )