请问这个问题解决了吗
createSelectorQuery 获取元素距顶高度不准 有时候还报错[代码]// 获取评论节点信息[代码][代码]queryMultipleNodes: [代码][代码]function[代码][代码]() {[代码][代码] [代码][代码]var[代码] [代码]query = wx.createSelectorQuery();[代码][代码] [代码][代码]//选择id[代码][代码] [代码][代码]query.select([代码][代码]'.comment-list-wrp'[代码][代码]).boundingClientRect()[代码][代码] [代码][代码]query.exec((res) => {[代码][代码] [代码][代码]//取高度[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]commentTop: res[0].top[代码][代码] [代码][代码]})[代码][代码] [代码][代码]})[代码][代码]},[代码] [代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]comment: result.items,[代码][代码] [代码][代码]current_page: result._meta.currentPage,[代码][代码] [代码][代码]count_page: result._meta.pageCount,[代码][代码] [代码][代码]}, () => { setTimeout(() => { [代码][代码]this[代码][代码].queryMultipleNodes()},1000)})[代码][图片] 然后偶尔会有这样的问题 是什么问题呢
2019-03-09