首先就是 tabber 的 list数量必须是偶数 然后是在pages.json中设置midButton 和tabber同级
然后到app.vue中设置 使用
uni.onTabBarMidButtonTap(()=>{
uni.navigateTo({
url: '****'
});
})
或者使用css 这个可以选定放大的tabber 也是在app.vue中 (这个我当时测试好像app没有用 只能实现h5)
.uni-tabbar {
/*.uni-tabbar__item:nth-last-child(3) 修改倒数第三个 也就是中间的图标 我这边底部栏是五个*/
.uni-tabbar__item:nth-last-child(3) {
.uni-tabbar__bd {
/*.uni-tabbar__icon 去掉原图标大小,强制为自适应宽高*/
.uni-tabbar__icon {
width: auto !important;
height: auto !important;
}
/*图标大小 !important 强制覆盖*/
img {
height: 70rpx !important;
width: 70rpx !important;
}
}
}
}