1. tabbar 组件
mounted(){ let dom = uni.createSelectorQuery().select('.tabbar-container') dom.boundingClientRect(e => { // tabbarHeight使用频次较高,就设为全局变量了 getApp().globalData.tabbarHeight = e.height }).exec() } {{ item.title }}
2. 引入
这里使用的是swiper,duration为0是为了关闭页面切换动画效果,
mounted() { this.tabbarHeight = getApp().globalData.tabbarHeight }, getCurrentIndex(e) { this.currentIndex = e; }