Open ghost opened 3 years ago
Do something like this:
data: function () {
let self = this;
return {
editorOption: {
keyboard: {
bindings: {
tab: false,
handleEnter: {
key: 13,
handler() {
console.log("enter works");
// reference self.theFunctionYouWantToCall()
},
},
},
}
}
I'm want to call a function from Vue's "methods" when an enter key is pressed within the scope of the Quill editor. I'm using Vue & Nuxt + SSR
Although binding the enter key correctly, it can't call vue methods or read data from "data". Could you please clarify how to use the keyboard module with vue data?