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)}) |
然后偶尔会有这样的问题 是什么问题呢