Content doesn't change after v-model is updated from dropdown Froala Editor VueJs

Viewed 17

My requirement is to bind text to Froala Editor based on dropdown value.

I set value to v-model.

<Carevender-Editor :dataValue="model.csContent" ref="froalaEditor"></Carevender-Editor>

I set immediateVueModelUpdate to true but it doesn't work.

config: {
          immediateVueModelUpdate:true,
}

I want to update content in editor after selecting dropdown. But now v-model doesn't update.

enter image description here

1 Answers

Finally I got it. I add function in Froala editor component to set value for model.

methods:{
   setValue(value){
     this.model = value;
   }
}

I add ref for editor component in other components

<Carevender-Editor @getText="getEditorValue" :dataValue="templatebody" ref="froalaEditor"></Carevender-Editor>

And then in dropdown selected change event, I call that ref with value.

selectedTemplate(value) {
          var tem = this.templates.filter(x => x.oid == value)[0];
          this.templatebody = tem.body;
          setTimeout(() => {
            this.isViewMode = false;
          }, 200);
      }
Related