小强哥博客-10年互联网人士

小强哥博客

10年互联网人士

关于uniapp富文本编辑器editor怎么初始化内容

本文发布于 2022-09-01 10:56:06,来自技术分享栏目

插入以下模板代码

<editor id=”editor” class=”ql-container” :placeholder=”placeholder” @ready=”onEditorReady”></editor>

JS代码部分如下

onEditorReady(){
uni.createSelectorQuery().select(‘#editor’).context((res) => {
this.editorCtx = res.context
this.editorCtx.setContents({
html:this.EditGoodsDetail.content //this.EditGoodsDetail.content为赋值内容。
})
}).exec()
}

文章评论

发表回复

Copyright © 小强哥博客
由 WordPress 驱动