egoist/vue-monaco

can't access to editor instance

Opened this issue · 1 comments

      <MonacoEditor
        class="editor"
        ref="editor"
        v-model="code"
        theme="gCodeFirst"
        language="GCodeLanguage"
        @editorWillMount="editorDidMount"
        :options="options"
      >
      </MonacoEditor>
    editorDidMount (editor) {
      // Register a new language
      editor.languages.register({ id: 'GCodeLanguage' })
      var e = this.$refs.editor.getEditor()
      console.log(e)
      ...............................................
     ...............................................

in the console I get undefined
this.$refs.editor ==> also does not give access to the instance
I need to use functions like getPosition(), setPosition() but i can't access the editor instance, only to the model

I experienced the same issue too, but was able to solve it like this....

this.$refs.editor[0].getEditor()