这是我的代码
const instance = getCurrentInstance();
uni.createSelectorQuery().in(instance).select(".data").boundingClientRect((rect) => {
console.log(rect.height)
})
.exec();
编译到安卓APP的时候会报错
20:43:53.326 [plugin:uni:app-uts] 编译失败
20:43:53.326 error: Unresolved reference: height
20:43:53.326 at components/fold/fold.uvue:69:20
20:43:53.328 67 | const instance = getCurrentInstance();
20:43:53.328 68 | uni.createSelectorQuery().in(instance).select(".data").boundingClientRect((rect) => {
20:43:53.328 69 | console.log(rect.height)
20:43:53.328 | ^
20:43:53.328 70 | })
20:43:53.328 71 | .exec();
试过了很多种方法,怎么都取不出里面的height
1 个回复
2***@qq.com (作者)
用浏览器运行的话可以打印出来