代码如下:
const query = wx.createSelectorQuery()
const selectors = '.share-report-li, #userInfoBorder, #userInfoHeadimgBorder, #userInfoHeadimg, #userInfoText, #evaluationContent, #knowledgeContentBorder, #knowledgeContent, #shareGroup, #shareLoc, #shareSmallprogramCode, #shareWeixin, #shareGrowUp'
query.selectAll(selectors).boundingClientRect()
query.selectViewport().scrollOffset()
query.exec(res => {
console.log('getLiNodes', res)
})
现象:
(1)获取节点信息有时会出现top负值,有时正常
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
是异步问题,做了个promise包装