收藏
回答

在组件中调用wx.createSelectorQuery().为null

    onEditorReady() {

      const  that = this;

      wx.createSelectorQuery().select('#editor').context(function (res) {

        that.editorCtx = res.context;

        res.context.setContents({

          html: that.data.value

        })

      }).exec()


    },

    imageOnLoad: function(e) {

      var that = this;


      wx.createSelectorQuery().in(this).select(".classTaskDetail").boundingClientRect(function(e) {

        if (e) {

          that.setData({

            height: e.height.toFixed(0)

          });

        }

      }).exec();

    },

请问下怎么才能正确获取,


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

4 个回答

  • hexford~🐶
    hexford~🐶
    2019-06-19



    这样写可以的呀

    2019-06-19
    有用 1
    回复 1
    • Actually
      Actually
      2019-07-12

      您好 我这边的ready函数没有触发 用的mpvue框架   ready触发方法放在methods里面  请问是啥原因呢


      2019-07-12
      回复
  • ゛
    2019-06-18

    wx 换成 this

    2019-06-18
    有用 9
    回复 1
    • xiao
      xiao
      04-05
      uniapp 里没有 this 啊
      04-05
      回复
  • 碎香菇
    碎香菇
    2022-06-21

    我这还是一样啊

    2022-06-21
    有用
    回复
  • 是小白啊
    是小白啊
    2019-06-17

    麻烦提供能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

    2019-06-17
    有用
    回复 3
登录 后发表内容