这个bug简直无话可说
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() |
选择不同元素,获取数据完全一样????