chmln / vue-wysiwyg

A lightweight WYSIWYG HTML editor for Vue.js
https://chmln.github.io/vue-wysiwyg/
MIT License
557 stars 136 forks source link

Using the component multiple times in the same parent #23

Closed ecerroni closed 6 years ago

ecerroni commented 6 years ago

First of all, kudos for you work as this is a very simple yet fully working component. It's slim and I like it much more that those bloated ones :+1:

It is generally working well but when I use it in a v-for directive.

Context: I have multiple articles in my form and each of them have a wysiwyg component. They are added and removed dynamically. So each form component can have 0+ wysiwyg content at any time.

<el-form-item
         v-for="(article, index) in campaign.articles"
         :key="index"
         :prop="'articles.' + index + '.value'"
         :id="`form_campaign_article_${index + 1}`"
       >

<wysiwyg :ref="wysiwygarticle${index + 1}" v-model="article.content" />

...

Issue: When I add a link to one of the wysiwyg all others get that link too.

link_not-working-as-expected

Expected behavior: The link should be added only to the current wysiwyg I'm writing on

I'd like to help if you can give me some directions on what I should look for to fix the issue

nawalnew commented 6 years ago

Same Issue here. Would be great if there is any solution for multiple Instances at one page

Samy-Amar commented 6 years ago

For those looking PR is in #24