uniapp 设置 tabbar 的 midButton 按钮

效果展示:

中间的国际化没生效(忽略就行) 

 示例代码:

然后在  App.vue 中进行监听:

<script>
	export default {
		onLaunch(e) {
			// #ifdef APP
			uni.onTabBarMidButtonTap(()=>{
				console.log("中间按钮点击回调");
			})
			// #endif
		}
	}
</script>

<style lang="scss">
</style>

 官方文档参考:pages.json 页面路由 | uni-app官网

猜你喜欢

转载自blog.csdn.net/weixin_59685936/article/details/142788516