Skip to content

Commit

Permalink
refactor: rename getMonaco to getEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Jun 26, 2019
1 parent be7eb56 commit 00228bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ window.MonacoEnvironment = {

### Methods

- `getMonaco(): IStandaloneCodeEditor`: Return the [editor instance](https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.istandalonecodeeditor.html).
- `getEditor(): IStandaloneCodeEditor`: Return the [editor instance](https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.istandalonecodeeditor.html).

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

## Contributing

Expand Down
5 changes: 5 additions & 0 deletions src/MonacoEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,15 @@ export default {
this.editor.onMouseUp(event => this.$emit('mouseUp', event))
},

/** @deprecated */
getMonaco() {
return this.editor
},

getEditor() {
return this.editor
},

focus() {
this.editor.focus()
}
Expand Down

0 comments on commit 00228bb

Please sign in to comment.