如何将后端返回的富文本内容再回填到editor中?

发布于 6 年前作者 pingliao4805 次浏览最后编辑 6 年前来自 issues

前端界面的富文本内容提交了,如何将后端返回的富文本内容再回填到editor中,以及展示到详情页中?

2 回复
min84
min841 楼6 年前

一直渲染失败是为什么?

ming98
ming982 楼5 年前

bindready 编辑器初始化完成时触发

EditorContext.setContents(Object object)

onEditorReady(description) {

const that = this

that.createSelectorQuery().select(‘#editor’).context(function (res) {

that.editorCtx = res.context

if (!res) return

that.editorCtx.setContents({

html: description ? description : ’ ',

success: function (res) {

console.log(“渲染成功”)

},

fail: function (err) {

console.log(“渲染失败”)

}

})

}).exec()