vue-quill-editor默认赋值问题
记录项目中遇到的vue-quill-editor在编辑时, 无法赋默认值问题<myQuill v-model="form.content" :value="'1231231'"></myQuill>↓↓↓<quill-editorref="myQuillEditor"v-model="content":options="options"...
·
记录项目中遇到的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
更多推荐
已为社区贡献3条内容
所有评论(0)