你的位置:首页 > 软件开发 > 网页设计 > 微软开源代码编辑器monaco

微软开源代码编辑器monaco

发布时间:2017-01-06 00:06:22
官网上给出:”The Monaco Editor is the code editor that powers VS Code. A good page describing the code editors features is here.  I ...

  

  官网上给出:”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 9/10/11, Edge, Chrome, Firefox, Safari and Opera.“

      Monaco Editor 展现还是非常牛的,直接上图:

     微软开源代码编辑器monaco

      https://microsoft.github.io/monaco-editor/

     下面给出一个入门教程:

     

 1 <!DOCTYPE html> 2 <html> 3 <head> 4   <meta http-equiv="X-UA-Compatible" content="IE=edge" /> 5   <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > 6 </head> 7 <body> 8  9 <div id="container" style="width:800px;height:600px;border:1px solid grey"></div>10 <div id="container2" style="width:800px;height:600px;border:1px solid grey"></div>11 <script src='/images/loading.gif' data-original="min/vs/loader.js"></script>12 <script>13   require.config({ paths: { 'vs': 'min/vs' }});14   require(['vs/editor/editor.main'], function() {15     var editor = monaco.editor.create(document.getElementById('container'), {16       value: [17         'function x() {',18         '\tconsole.log("Hello world!");',19         '}'20       ].join('\n'),21       language: 'javascript'22     });23 24     var editor2 = monaco.editor.create(document.getElementById('container2'), {25       value: [26         'function x() {',27         '\tconsole.log("Hello world!");',28         '}'29       ].join('\n'),30       language: 'csharp',31       theme:'vs-dark'32     });33 34     35   });36 37   function changeTheme(theme) {38     var newTheme = (theme === 1 ? 'vs-dark' : ( theme === 0 ? 'vs' : 'hc-black' ));39     if (editor) {40       editor.updateOptions({ 'theme' : newTheme });41     }42     if (diffEditor) {43       diffEditor.updateOptions({ 'theme': newTheme });44     }45   }46 </script>47 </body>48 </html>

 

海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com

原标题:微软开源代码编辑器monaco

关键词:微软

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。