代码编辑器monaco-editor之基础使用

前端之家收集整理的这篇文章主要介绍了代码编辑器monaco-editor之基础使用前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

 

1.下载安装monaco-editor

npm install monaco-editor

 

我的安装目录在

C://Windows//SystemApps//Microsoft.MicrosoftEdgeDevToolsClient_8wekyb3d8bbwe//23//common//monaco-editor/

 

2.集成界面

<!DOCTYPE html>
<htmlhead>
    Meta http-equiv="X-UA-Compatible" content="IE=edge" />
    ="Content-Type"="text/html;charset=utf-8" </bodydiv id="container" style="width:800px;height:600px;border:1px solid grey"></divscript src="C://Windows//SystemApps//Microsoft.MicrosoftEdgeDevToolsClient_8wekyb3d8bbwe//23//common//monaco-editor//min//vs//loader.js"script>
    require.config({ paths: { 'vs: C://Windows//SystemApps//Microsoft.MicrosoftEdgeDevToolsClient_8wekyb3d8bbwe//23//common//monaco-editor//min//vs }});
    require([vs/editor/editor.main],function() {
        var editor = monaco.editor.create(document.getElementById(container),{
            value: [
                function x() {,1)">\tconsole.log("Hello world!");}
            ].join(\njavascript
        });
    });
>

 

3.运行结果

 

猜你在找的程序笔记相关文章