From ba2bebb4069085817a90d065ed5877fdb50a8039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A0=E6=9C=A8?= Date: Thu, 27 May 2021 19:14:31 +0800 Subject: [PATCH] fix(codeeditor): empty value set failed.fixed:#659 --- src/components/CodeEditor/src/codemirror/CodeMirror.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/CodeEditor/src/codemirror/CodeMirror.vue b/src/components/CodeEditor/src/codemirror/CodeMirror.vue index 0e7a61a5..5d50737b 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' } );