uView2.0
uView2.0 copied to clipboard
getRect() 获取不到数据
版本
2.0.33
转载链接
重现步骤
//使用下面的方法没有任何数据打印
uni.$u.getRect('.category-product-container').then(res => { console.log(111, res) })
//使用下面的方法可以打印数据
uni.createSelectorQuery().select('.category-product-container').boundingClientRect(res => { console.log(222, res) }).exec()
期望的结果是什么?
getRect 方法可以使用
实际的结果是什么?
在 onPageScroll 中使用 getRect 方法链式调用 then 和 catch 都获取不到数据,报 An SelectorQuery call is ignored because no proper page or component is found. Please considering using SelectorQuery.in
to specify a proper one.