From 3a51d80ed2ca74ad0865dacb9739a045ab4c5c62 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Tue, 2 Aug 2022 12:07:24 +0530 Subject: [PATCH] chore/gui-v2-json-minor-cleanup --- packages/nc-gui-v2/components/cell/Json.vue | 4 ++-- packages/nc-gui-v2/components/monaco/Editor.vue | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/nc-gui-v2/components/cell/Json.vue b/packages/nc-gui-v2/components/cell/Json.vue index b4fb09e740..fad7d4248e 100644 --- a/packages/nc-gui-v2/components/cell/Json.vue +++ b/packages/nc-gui-v2/components/cell/Json.vue @@ -80,10 +80,10 @@ watch( :hide-minimap="true" @validation-error="onError" @update:model-value="localValue = $event" - @value-changed="resetError" + @text-changed="resetError" /> - {{ error?.toString() }} + {{ error.toString() }} {{ vModel }} diff --git a/packages/nc-gui-v2/components/monaco/Editor.vue b/packages/nc-gui-v2/components/monaco/Editor.vue index a833718c64..bbf99fabbb 100644 --- a/packages/nc-gui-v2/components/monaco/Editor.vue +++ b/packages/nc-gui-v2/components/monaco/Editor.vue @@ -14,7 +14,7 @@ interface Props { interface Emits { (event: 'update:modelValue', model: any): void (event: 'validationError', error: any): void - (event: 'valueChanged'): void + (event: 'textChanged'): void } const props = defineProps() @@ -84,7 +84,7 @@ onMounted(() => { try { isValid.value = true const obj = JSON.parse(editor.getValue()) - emits('valueChanged') + emits('textChanged') if (!deepCompare(vModel, obj)) vModel = obj } catch (e) { isValid.value = false @@ -107,6 +107,7 @@ watch( editor.setValue(JSON.stringify(v, null, 2)) } } catch (e) { + console.log(e) editor.setValue(JSON.stringify(v, null, 2)) } },