Commit ba2bebb4069085817a90d065ed5877fdb50a8039
1 parent
7e2ca79e
fix(codeeditor): empty value set failed.fixed:#659
Showing
1 changed file
with
3 additions
and
1 deletions
src/components/CodeEditor/src/codemirror/CodeMirror.vue
@@ -53,7 +53,9 @@ | @@ -53,7 +53,9 @@ | ||
53 | async (v) => { | 53 | async (v) => { |
54 | await nextTick(); | 54 | await nextTick(); |
55 | const oldValue = editor?.getValue(); | 55 | const oldValue = editor?.getValue(); |
56 | - v && v !== oldValue && editor?.setValue(v); | 56 | + if (v !== oldValue) { |
57 | + editor?.setValue(v ? v : ''); | ||
58 | + } | ||
57 | }, | 59 | }, |
58 | { flush: 'post' } | 60 | { flush: 'post' } |
59 | ); | 61 | ); |