Answer the question
In order to leave comments, you need to log in
How to initiate a change in the value of a variable bound to a field through v-model?
I embed the markitup editor in the vue component, but when I insert any tags into the text, the value of the variable bound to the field through v-model does not change. The editor has the option to use the afterInsert method , which is what I did
afterInsert: function() {
this.textarea.dispatchEvent(new Event("change"));
},
Answer the question
In order to leave comments, you need to log in
It was necessary like this:this.textarea.dispatchEvent(new Event("input"));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question