赞
踩
所以说,想要h5或者小程序支持,请另寻其他文章
"tabBar": { "selectedColor":"#0c73fe", "color":"#ccc", "list": [ { "text":"首页", "pagePath":"pages/index/index", "iconPath":"static/icon/home.png", "selectedIconPath":"static/icon/home_active.png" }, { "text":"项目圈", "pagePath":"pages/project_moments/project_moments", "iconPath":"static/icon/moments.png", "selectedIconPath":"static/icon/moments_active.png" }, { "text":"资料", "pagePath":"pages/project_data/project_data", "iconPath":"static/icon/data.png", "selectedIconPath":"static/icon/data_active.png" }, { "text":"我的", "pagePath":"pages/personal_center/personal_center", "iconPath":"static/icon/my.png", "selectedIconPath":"static/icon/my_active.png" } ], "midButton": { "width": "60px", "height": "60px", "iconPath": "static/icon/pic.png", "iconWidth": "55px" } }
midButton的节点配置是不包含在tabBar中的,所以中间按钮 仅在 list 项为偶数时有效
因为中间按钮是没有对应的page页面的,所以将这个监听注册在App.vue中比较合适:
<script>
export default {
onLaunch: function() {
// tabbar中间按钮点击事件
uni.onTabBarMidButtonTap(function(e){
uni.showToast({
title:'点我干嘛',
duration: 1500,
icon:'none'
});
})
},
}
</script>
完事
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。