我真服了这个问题啦,An SelectorQuery call is ignor
发布于 5 年前 作者 minghu 3329 次浏览 来自 问答
  • 一直报到死的警告,死都获取不到组件

VM54:1 An SelectorQuery call is ignored because no proper page or component is found. Please considering using `SelectorQuery.in` to specify a proper one.

  • 放在onLoad里不行,放在onReady里也不行,延迟5秒都还不行,到底行不行啦!
const query = wx.createSelectorQuery().in(this)
    query.select('#old-house-chat').boundingClientRect(function(res){
      res.top // 这个组件内 #the-id 节点的上边界坐标
    }).exec()

<view class=“ec-expontent>

<ec-canvas id=“sell-house-chatcanvas-id=“old-house-chatclass=“ec-canvas mychartec="{{ sellhouseEc }}"></ec-canvas>

</view>

2 回复

,你换下ID试试

这个是我在提问题的时候写错啦,我代码里写的事对的。 主要是这个问题只有在第一次使用,或者开发者工具第一次打开的时候才会出现,重新进入就正常啦,很邪门啊,我猜测应该是小程序加载时usingComponents太慢的原因。

回到顶部