diff --git a/src/frontend/src/components/ace-editor/index.vue b/src/frontend/src/components/ace-editor/index.vue index 501116907d..23d9403c2c 100644 --- a/src/frontend/src/components/ace-editor/index.vue +++ b/src/frontend/src/components/ace-editor/index.vue @@ -297,11 +297,13 @@ watch: { value: { handler (value) { + this.editor.getSession().setAnnotations([]); // 只读模式没有默认值,直接使用输入值 if (this.readonly) { this.editor.setValue(Base64.decode(value)); this.editor.clearSelection(); this.syntaxCheck(value); + return; } // 外部传入空置直接清空编辑器 if (value === '' && this.content !== '') {