[英]How do you set monaco-editor from readonly to writeable?
在我的代码中,我创建了一个编辑器,如下所示:
this.monacoEditor = monaco.editor
.create(
document.getElementById('ide'), {
model: null,
readOnly: true,
contextmenu: false,
}
);
因此,该编辑器现在是只读的。 我如何将this.monacoEditor
更改为可写/可编辑?
我想到了。 在以上代码的上下文中:
this.monacoEditor.updateOptions({readOnly: false});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.