想在项目中有类似编辑器的功能,用以编辑展示数据。用到了monaco-editor,更多请查阅文档 https://microsoft.github.io/monaco-editor/
安装依赖
npm install monaco-editor --save
在 vue 中使用
<!-- 容器 -->
<div ref="main"></div>
// 引用组件
import * as monaco from 'monaco-editor/esm/vs/editor/editor.main.js'
import 'monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution'
// 使用 - 创建 monacoEditor 对象
thi