4***@qq.com
4***@qq.com
  • 发布:2020-06-08 16:16
  • 更新:2022-11-23 11:47
  • 阅读:4947

【报Bug】page is not ready at view.umd.min.js

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10

HBuilderX类型: 正式

HBuilderX版本号: 2.7.9

手机系统: Android

手机系统版本号: Android 9.0

手机机型: casio

页面类型: vue

打包方式: 离线

项目创建方式: HBuilderX

操作步骤:

uni.createSelectorQuery().select('.itemview').boundingClientRect().exec(function(res) {
if (res[0]) {
_self.item_height = res[0].height;
}
});

预期结果:

_self.item_height =168

实际结果:

_self.item_height =0

bug描述:

uni.createSelectorQuery() 在APP端 会报错“ TypeError: Cannot read property '$page' of undefined at view.umd.min.js:1”

2020-06-08 16:16 负责人:DCloud_UNI_GSQ 分享
已邀请:
DCloud_UNI_GSQ

DCloud_UNI_GSQ

请在 onReady 生命周期后调用

4***@qq.com

4***@qq.com (作者)

调试补充如下图

9***@qq.com

9***@qq.com

mounted() {
uni.createSelectorQuery().in(this).select(".navbar-element").boundingClientRect(data => {
console.log(JSON.stringify(data))
}).exec()
},

要回复问题请先登录注册