记录项目中遇到的vue-quill-editor在编辑时, 无法赋默认值问题

<myQuill v-model="form.content" :value="'1231231'"></myQuill>
↓
↓
↓
<quill-editor
  ref="myQuillEditor"
  v-model="content"
  :options="options"
  @ready="onEditorReady($event)">   
</quill-editor>

script部分
props: ['value']
data: { content: '' }
methods: {
   onEditorReady(dom)  {
        this.content = this.value    // 在ready方法中手动赋值
    }
}
watch: {
    value (val) {
      this.content = val    // 未生效
    }
}

参考资料:

     使用文档: https://www.awesomes.cn/repo/surmon-china/vue-quill-editor

Logo

前往低代码交流专区

更多推荐