MonacoEditor component for Vue.js
Switch branches/tags
Nothing to show
Clone or download
Latest commit 8573b80 Nov 9, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
example add esm support Aug 2, 2018
src fix lint Aug 2, 2018
.editorconfig init Aug 3, 2017
.gitattributes init Aug 3, 2017
.gitignore init Aug 3, 2017
LICENSE init Aug 3, 2017 Typo, fix #15 Nov 9, 2018
circle.yml init Aug 3, 2017
package.json Release v0.2.0 Aug 2, 2018
poi.config.js fix lint Aug 2, 2018
yarn.lock add esm support Aug 2, 2018


NPM version NPM downloads CircleCI donate

Monaco Editor is the code editor that powers VS Code.


yarn add vue-monaco


To use with webpack:

// webpack.config.js
const MonocoEditorPlugin = require('monaco-editor-webpack-plugin')

module.exports = {
  plugins: [
    new MonocoEditorPlugin()

Then use the component:


import MonacoEditor from 'vue-monaco'

export default {
  components: {

  data() {
    return {
      code: 'const noop = () => {}'

.editor {
  width: 600px;
  height: 800px;


  • code
  • language
  • theme
  • options


Event IStandaloneCodeEditor Event Parameters
editorDidMount IStandaloneCodeEditor
contextMenu onContextMenu IEditorMouseEvent
blur onDidBlurEditor
blurText onDidBlurEditorText
configuration onDidBlurEditorText IConfigurationChangedEvent
position onDidChangeCursorPosition ICursorPositionChangedEvent
selection onDidChangeCursorSelection ICursorSelectionChangedEvent
model onDidChangeModel IModelChangedEvent
change onDidChangeModelContent value: string, e: IModelContentChangedEvent
modelDecorations onDidChangeModelDecorations IModelDecorationsChangedEvent
modelLanguage onDidChangeModelLanguage IModelLanguageChangedEvent
modelOptions onDidChangeModelOptions IModelOptionsChangedEvent
afterDispose onDidDispose
focus onDidFocusEditor
focusText onDidFocusEditorText
layout onDidLayoutChange EditorLayoutInfo
scroll onDidScrollChange IScrollEvent
keydown onKeyDown IKeyboardEvent
keyup onKeyUp IKeyboardEvent
mouseDown onMouseDown IEditorMouseEvent
mouseLeave onMouseLeave IEditorMouseEvent
mouseMove onMouseMove IEditorMouseEvent
mouseUp onMouseUp IEditorMouseEvent


Use ref to interact with the MonacoEditor component in order to access methods: <MonacoEditor ref="editor"></MonacoEditor>, then this.$refs.editor.getMonaco() will be available.


  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D


vue-monaco © egoist, Released under the MIT License.
Authored and maintained by egoist with help from contributors (list). · GitHub @egoist · Twitter @_egoistlily