"tabBar":{ "color":"#333333", "selectedColor":"#2a75f6", "backgroundColor":"#f4f1f1", "position":"bottom", "borderStyle":"white", "list":[ { "pagePath":"pages/Home/Home", "text":"", "iconPath":"static/icon/hands-fill-2.png", "selectedIconPath":"static/icon/hands-fill.png" }, { "pagePath":"pages/College/College", "text":"", "iconPath":"static/icon/xueyuan.png", "selectedIconPath":"static/icon/xueyuan-2.png" }, { "pagePath":"pages/Mine/Log/Log", "text":"", "iconPath":"static/icon/rizhi-2.png", "selectedIconPath":"static/icon/rizhi.png" }, { "pagePath":"pages/Mine/Mine", "text":"", "iconPath":"static/icon/wode.png", "selectedIconPath":"static/icon/wode-2.png" } ], "midButton": { "width": "60px", "height": "60px", "iconPath": "static/icon/kongzhitai.png", "iconWidth": "40px", "text":"控制台", "backgroundImage":"static/icon/yuan-2.png" } },
监听midButton点击事件
// App.vue 中监听
onLaunch: function() { // tabbar中间按钮点击事件 uni.onTabBarMidButtonTap(function(e){ uni.navigateTo({ url: "/pages/Home/Console/Console", animationType: "slide-in-bottom", // 动画类型 animationDuration: 150, // 窗口动画持续时间,单位为 ms fail(err) { console.log(err) } }) }) }