收藏
回答

微信小程序中的editor富文本标签?

请问有人知道<editor></editor>如何给这标签附上初始数据吗?

还有就是如何让他自动聚焦focus



回答关注问题邀请回答
收藏

2 个回答

  • 拾忆
    拾忆
    2019-10-08

    bindready="onEditorReady" EditorContext.setContents({ html:"出入的内容"})


    2019-10-08
    有用
    回复 7
    查看更多(2)
  • Gavin²º²º
    Gavin²º²º
    2019-10-08

    onEditorReady

    2019-10-08
    有用
    回复 2
    • 相亲💋相爱
      相亲💋相爱
      2019-10-08
      下面的context这个要报错
      onEditorReady() {
      // 输入~编辑框
      wx.createSelectorQuery().select('#editor').context(function(res) {
      that.editorCtx = res.context;
      console.log("初始化成功:" + wx.getStorageSync("content"))
      if (wx.getStorageSync("content")) { // 设置~历史值
      that.editorCtx.insertText(wx.getStorageSync("content")) // 注意:插入的是对象
      }
      }).exec()

      },
      2019-10-08
      回复
    • 拾忆
      拾忆
      2019-10-08
      that.ediotrCtx.insertText({ text:"需要出入的内容"})
      2019-10-08
      回复
登录 后发表内容
问题标签