Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.

Conversation

@marktinsley
Copy link

The way this is currently working, it's expecting that the contents for
the editor will be provided so that the editor can be loaded with them
when the component is ready in the DOM. In my use case, however, I
needed to load the contents asynchronously. These changes allow for that
by an explicit Vue watcher on the content property. It only communicates
property changes to the editor if they are not equal to what the editor
currently has; a not so elegant way to see where the changes are coming
from: the editor itself or changes to the component's content property
from outside the component.

The set-html event is a possible way to accomplish this. I just didn't want to have to create a function on my parent component for each of the Quill editors that I wanted on my page.

The way this is currently working, it's expecting that the contents for
the editor will be provided so that the editor can be loaded with them
when the component is ready in the DOM. In my use case, however, I
needed to load the contents asynchronously. These changes allow for that
by an explicit Vue watcher on the content property. It only communicates
property changes to the editor if they are not equal to what the editor
currently has; a not so elegant way to see where the changes are coming
from: the editor itself or changes to the component's content property
from outside the component.
@BrockReece
Copy link
Contributor

Thanks for the PR, maybe this is something I will need to look into but I don't like that the watcher will be triggered every time there is a change in the editor too.

If you are just waiting for data to load from an ajax request, could you add a v-if so that it will only load the vue-quill component once there is data to display?

Cheers
Brock

@marktinsley
Copy link
Author

I'll give the v-if approach a try. Yea, I agree. Not the smartest way to accomplish less of a hands-on experience.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants