Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't access to editor instance #189

Open
inghvar opened this issue Jul 2, 2021 · 1 comment
Open

can't access to editor instance #189

inghvar opened this issue Jul 2, 2021 · 1 comment

Comments

@inghvar
Copy link

inghvar commented Jul 2, 2021

      <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

@barrybb
Copy link

barrybb commented Oct 18, 2021

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants