monaco-editor介绍
官方介绍:
The Monaco Editor is the code editor that powers VS Code. A good page describing the code editor’s features is here.
It is licensed under the MIT License and supports IE 11, Edge, Chrome, Firefox, Safari and Opera.
The Monaco editor is not supported in mobile browsers or mobile web frameworks.
Find more information at the Monaco Editor repo.
下载地址也可以使用npm install monaco-editor
页面中使用
在页面中引用1
<script src="monaco-editor/min/vs/loader.js"></script>
获取所有language
1 | monaco.languages.getLanguages(); |
设置language
1 | var newModel = monaco.editor.createModel("class A{}", "java"); |
共三个主题
‘vs’ | ‘vs-dark’ | ‘hc-black’;
设置主题
1 | monaco.editor.setTheme("hc-black"); |