-
-
Notifications
You must be signed in to change notification settings - Fork 380
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
editor instance accessibility #8
Comments
assign a reference ID to the component using <codemirror v-model="code" ref="codemirror"></codemirror> then access the editor instance this.$refs.codemirror.editor |
I did it! |
"vue-codemirror": "^4.0.6", var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
mode: "htmlmixed",
extraKeys:{"Shift-Tab":autoFormatSelection}
}); however I get 'undefined' by this.$refs.codemirror.editor. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I'm sorry poor English.
I'm using this library. Thank you for making.
so, I want to use "Autoformart" function like this.
https://codemirror.net/2/demo/formatting.html
but, editor instance cannot access parant component.
https://github.com/surmon-china/vue-codemirror/blob/master/codemirror.vue#L69
Could you make editor instance accessible, or add function like calling parent method?
The text was updated successfully, but these errors were encountered: