这个bug简直无话可说
发布于 6 年前 作者 haojie 7966 次浏览 来自 问答
const query = wx.createSelectorQuery()             query.select('.main-container').boundingClientRect(res => {                 console.log('.main-container', e.scrollTop, res.top)                 this.setData({                     //节点的上边界坐标                     headFixed: res.top <= 0,                 })             }).exec()
 
            query.select('.fixed-head').boundingClientRect(res => {                 console.log('.fixed-head', e.scrollTop, res.top)                 this.setData({                     //节点的上边界坐标                     headFixed: res.top <= 0,                 })             }).exec() 
 
           query.select('.scroll-view-container').boundingClientRect(res => {                 console.log('.scroll-view-container', e.scrollTop, res.top)                 this.setData({                     //节点的上边界坐标                     headFixed: res.top <= 0,                 })             }).exec()

选择不同元素,获取数据完全一样????

回到顶部