diff --git a/src/components/CodeEditor/src/codemirror/CodeMirror.vue b/src/components/CodeEditor/src/codemirror/CodeMirror.vue index 0e7a61a53f2..5d50737be6e 100644 --- a/src/components/CodeEditor/src/codemirror/CodeMirror.vue +++ b/src/components/CodeEditor/src/codemirror/CodeMirror.vue @@ -53,7 +53,9 @@ async (v) => { await nextTick(); const oldValue = editor?.getValue(); - v && v !== oldValue && editor?.setValue(v); + if (v !== oldValue) { + editor?.setValue(v ? v : ''); + } }, { flush: 'post' } );