tinymce-vue-2 icon indicating copy to clipboard operation
tinymce-vue-2 copied to clipboard

Two way binding doesn't work?

Open Adam-78 opened this issue 7 years ago • 2 comments

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?

Adam-78 avatar Dec 05 '17 17:12 Adam-78

I've had to add the following code to fix:

  watch: {
            value () {
                if (this.value == '')
                    if (typeof tinyMCE != "undefined") {
                        tinymce.get(this.id).setContent('');
                    }
            }
        },

Adam-78 avatar Dec 05 '17 18:12 Adam-78

watch: {
    value: function(newVal, unusedOldVal) {
      window.tinymce.get(this.id).setContent(newVal);
    }
}

mikermcneil avatar Aug 10 '18 23:08 mikermcneil