- 构建失败,提示 miniprogram_npm库找不到?
module "miniprogram_npm/side-channel/call-bind/callBound" is not defined 之前都很正常,今天十点构建就开始报这个错了。拉取master分支来构建一样是这个错(所以不是代码的问题)
2021-03-19 - 如何解决createSelectorQuery无法获取不到节点?
console.log(this)[代码] [代码][代码]const query = wx.createSelectorQuery().[代码][代码]in[代码][代码]([代码][代码]this[代码][代码])[代码][代码] [代码][代码]query.select([代码][代码]'.pp-navbar__item'[代码][代码]).boundingClientRect([代码][代码]function[代码] [代码](rect) {[代码][代码] [代码][代码]// this.sliderOffset = rect[1].width;[代码][代码] [代码][代码]// this.setData({[代码][代码] [代码][代码]// sliderOffset:rect[1].width[代码][代码] [代码][代码]// });[代码][代码] [代码][代码]console.log([代码][代码]this[代码][代码])[代码][代码] [代码][代码]console.log(rect[0].width)[代码][代码] [代码][代码]}).exec()[代码] 需求:想要获取节点的宽度,并传入data中,保存起来 报错 [图片] [代码]VM2604:1 An SelectorQuery call is ignored because no proper page or component is found. Please considering using `SelectorQuery.[代码][代码]in[代码][代码]` to specify a proper one.[代码] 我明明打印的出this,为什么还说我组件不明确? 我看官方文档也是这样写的呀 [图片] 希望能得到解答,康萨迷大!
2019-10-17