Forráskód Böngészése

fix(codeeditor): empty value set failed.fixed:#659

无木 3 éve
szülő
commit
ba2bebb406

+ 3 - 1
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' }
       );