guhongwei 2 年之前
父节点
当前提交
c879866eb1
共有 1 个文件被更改,包括 3 次插入10 次删除
  1. 3 10
      commpents/hg-editor/hg-editor.js

+ 3 - 10
commpents/hg-editor/hg-editor.js

@@ -43,16 +43,9 @@ Component({
         _onEditorReady: async function () {
             const that = this;
             that.createSelectorQuery().select('#editor').context(function (res) {
-                that.editorCtx = res.context
-                let html = that;
-                if (html) {
-                    that.editorCtx.setContents({
-                        html: html,
-                        success: (res) => {
-                        },
-                        fail: (res) => { console.log(res) }
-                    })
-                }
+                that.editorCtx = res.context;
+                let html = that.data.name;
+                if (html) that.editorCtx.setContents({ html })
             }).exec()
         },
         //插入图片