- 开始我是这样写的,怎样都获取不到
let query = wx.createSelectorQuery();
let id = `#nav-item${this.data.active}`
query = query.selectAll(id).boundingClientRect();
- 直到我看到这一句话 ,应把wx. 换成this.
修改后
let query = this.createSelectorQuery();
let id = `#nav-item${this.data.active}`
query = query.selectAll(id).boundingClientRect();