Browse Source
Merge pull request #824 from colinin/code-mirror-refesh-style-when-value-changed
fix(code-mirror): refresh the style when the value changes
pull/830/head
yx lin
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
0 deletions
-
apps/vue/src/components/CodeEditor/src/codemirror/CodeMirror.vue
|
|
@ -46,6 +46,7 @@ |
|
|
const oldValue = editor?.getValue(); |
|
|
const oldValue = editor?.getValue(); |
|
|
if (value !== oldValue) { |
|
|
if (value !== oldValue) { |
|
|
editor?.setValue(value ? value : ''); |
|
|
editor?.setValue(value ? value : ''); |
|
|
|
|
|
setTimeout(refresh, 50); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
{ flush: 'post' }, |
|
|
{ flush: 'post' }, |
|
|
|