tinymce-vue-2
tinymce-vue-2 copied to clipboard
Two way binding doesn't work?
If you have some thing as follows:
<tiny-mce id="description" v-model="description"></tiny-mce>
If you update description
outside of tinymce editor, then tinymce editor does not reflect the changed value.
It only seems to work one way i.e. changes made inside tinymce will update the description but not the other way round.
When I reset description outside of tinymce how can I update tinymce to reflect the same?
I've had to add the following code to fix:
watch: {
value () {
if (this.value == '')
if (typeof tinyMCE != "undefined") {
tinymce.get(this.id).setContent('');
}
}
},
watch: {
value: function(newVal, unusedOldVal) {
window.tinymce.get(this.id).setContent(newVal);
}
}