本文共 284 字,大约阅读时间需要 1 分钟。
1.tabbar组件ready方法中
ready() { // 缓存tabber栏的高度 const query = wx.createSelectorQuery().in(this) query.select('.tabbar').boundingClientRect((rect) => { // console.log(rect.height) wx.setStorageSync('tabbberHeight', rect.height) }).exec() },
2.tabar的html中需要加上一个类名
3.使用的时候直接从缓存中获取值
转载地址:http://hrpzb.baihongyu.com/