I've encountered an issue with my Vue component that uses Vue2Editor. Everything was working great until I tried to update the content using data from an async function.
To troubleshoot, I tested updating text in a simple div.
Here's a snippet of my async function code:
async getPost(id) {
this.content = "Here works"; // Update both content
const {data} = await pressRepository.getPost(id)
document.getElementsByClassName("ql-editor")[0].focus();
this.content = data.article; // Update just the div content
}
Success:
<div> {{content}}</div>
Issue:
<vue-editor v-model="content" :editorToolbar="customToolbar"></vue-editor>
[EDIT]
Fixed! by commenting out this line:
//document.getElementsByClassName("ql-editor")[0].focus();