1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| const topTabList = [ { name: '锚点一', point: 0 }, { name: '锚点二', point: 0 }, { name: '锚点三', point: 0 }, ] getScrollPoint(className) { const systemInfo = uni.getSystemInfoSync() let query = '' query = uni.createSelectorQuery().in(this.$parent) query = uni.createSelectorQuery() query.selectAll(`.${className}`).boundingClientRect().exec((res) => { res[0].forEach((v, i) => { topTabList[i].point = v.top - v.height - 20 - (systemInfo.platform === 'ios' ? 44 : 48) }) }) }
|