Local Registration // main.tsimport{loader}from'@guolao/vue-monaco-editor'loader.config({paths:{vs:'https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs',},})// editor.vueimport{VueMonacoEditor}from'@guolao/
Monaco Editor for Vue.. Latest version: 1.0.10, last published: 5 years ago. Start using monaco-editor-vue in your project by running `npm i monaco-editor-vue`. There are 16 other projects in the npm registry using monaco-editor-vue.
使用npm 安装对应版本号 "monaco-editor":"0.27.0","monaco-editor-webpack-plugin":"4.2.0" 使用 import*asmonacofrom"monaco-editor"; 子组件 <template></template>import*asmonacofrom"monaco-editor";exportdefault{data() {return{monacoEditor:null, }; },mounted() {this.init(); },methods: {init...
npm install vite-plugin-monaco-editor --save-dev 2. 在Vue组件中初始化monaco-editor 在Vue组件中,你需要有一个DOM元素作为Monaco Editor的容器,并在组件挂载时初始化编辑器。 Vue 2 示例: vue <template> <div ref="container" style="width: 100%; height: 500px;"></div> ...
npm install monaco-editor@0.30.1 --save-dev npm install monaco-editor-webpack-plugin@6.0.0 --save-dev 1 2配置vue.config.js中配置const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin') module.exports = { configureWebpack: { plugins: [ new MonacoWebpackPlugin() ] } } 1...
npm install monaco-editor@0.21.2--save npm install monaco-editor-webpack-plugin--save//这个必须安装,不然起不来 2.2 配置文件 修改webpack.base.conf.js配置文件。(前几步借鉴时间脱臼大神博客,步骤大同小异) constMonacoWebpackPlugin=require('monaco-editor-webpack-plugin');module.exports= { ...
npm install monaco-editor-esm-webpack-plugin --save-dev // 引入 font-awesome 图标库,非必须 npm install font-awesome --save 父组件:index.vue <template><el-buttontype="primary"@click="handleMEContentChangeClick">OK</el-button><MonacoEditorclass="monaco-editor"ref="monacoEditorRef":editorParam...
# monaco-editor 和 vite 插件npmi monaco-editor@0.33.0vite-plugin-monaco-editor vite-plugin-monaco-editor 最新的版本是 22 年 7 月发布,依赖 monaco-editor 的版本是 0.33.0。用这两个版本肯定万无一失。 vite config 配置 vite config 增加如下配置 ...
npm install monaco-editor@0.21 npm install monaco-editor-webpack-plugin@2 -D 1. 2. 需要注意的是他们两个的版本需要对应好,否则可能会报错,对应版本如下 实现 配置插件,vue.config.js中配置 // 引入插件 const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin') ...
monaco-editor是一款代码编辑器,使用它我们可以再web实现vscode的基本功能,下面是在vue中使用monaco-editor流程 安装 npminstallmonaco-editor monaco-editor-webpack-plugin vue.config.js配置 这里我只添加了针对js的代码提示,如果只填写js的代码提示会发现并没有左右,后来在monaco-editor-webpack-plugin的介绍中发现了...