Vue: VueJS makes TinyMCE text disappeared unexpectedly even though there is no data binding

Created on 11 Apr 2017  路  3Comments  路  Source: vuejs/vue

Version

2.2.6

Reproduction link

https://jsfiddle.net/78hqbj8f/

Steps to reproduce

Just run the code at https://jsfiddle.net/78hqbj8f/

What is expected?

If there's no Vue data binding to an element Vue should keep that element as it is.

What is actually happening?

VueJS has made TinyMCE text disappeared and the editor becomes uneditable even though there's no data binding to the textarea/editor.

Most helpful comment

But are you sure that this is expected behaviour of VueJS?

Vue replaces the DOM in #main when mounting - if other Javascript libs rely on that DOM., this can lead to all sorts of unexpected behaviour, depending on the lib in question.

That's why you should iniit tinymce after Vue, and preferably from a Vue lifecycle hook like mounted()

All 3 comments

This is expected behaviour because Vue manipulates the dom, you need to integrate this kind of plugins as components. You can use this: https://github.com/j6montoya/vue-tinymce

Thanks @posva.

I know that Vue manipulates the dom and I also know about that vue-tinymce component.

But are you sure that this is expected behaviour of VueJS?

This is just a problem with the tinymce editor. How can I know if there're not other similar side effects?

But are you sure that this is expected behaviour of VueJS?

Vue replaces the DOM in #main when mounting - if other Javascript libs rely on that DOM., this can lead to all sorts of unexpected behaviour, depending on the lib in question.

That's why you should iniit tinymce after Vue, and preferably from a Vue lifecycle hook like mounted()

Was this page helpful?
0 / 5 - 0 ratings

Related issues

karevn picture karevn  路  42Comments

ecmel picture ecmel  路  52Comments

Akryum picture Akryum  路  34Comments

cherry-geqi picture cherry-geqi  路  35Comments

wenLiangcan picture wenLiangcan  路  39Comments