@lambo-design/monaco-editor
v1.0.0-beta.6
Published
``` yarn add @lambo-desing/monaco-editor ```
Downloads
30
Readme
使用
yarn add @lambo-desing/monaco-editor
vue.config.js配置
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin')
const MonacoLocalesPlugin = require('monaco-editor-locales-plugin')
module.exports = {
...,
configureWebpack:{
...,
plugins: [
...,
new MonacoWebpackPlugin({
// available options are documented at https://github.com/Microsoft/monaco-editor-webpack-plugin#options
languages: ['javascript', 'css', 'html', 'typescript', 'json', 'java'],
features: ["coreCommands", "find", "format", "folding", 'smartSelect', 'snippets', 'suggest', 'hover']
}),
new MonacoLocalesPlugin({
//设置支持的语言
languages: ["es", "zh-cn"],
//默认语言
defaultLanguage: "zh-cn",
//打印不匹配的文本
logUnmatched: false,
//自定义文本翻译
mapLanguages: { "zh-cn": { "Peek References": "查找引用", "Go to Symbol...": "跳到变量位置", "Command Palette": "命令面板" } }
})
]
}
}