tabBar
如果小程序是一个多 tab 应用(客户端窗口的底部或顶部有 tab 栏可以切换页面),可以通过 tabBar 配置项指定 tab 栏的表现,以及 tab 切换时显示的对应页面。
{
"pages": [
"pages/index/index",
"pages/logs/logs",
"pages/movie/movie",
"pages/userinfo/userinfo",
"pages/navigateTo/navigateTo"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "我的小程序",
"navigationBarTextStyle": "black",
"navigationStyle": "default"
},
"tabBar": {
"selectedColor": "green",
"borderStyle": "white",
"list": [
{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "images/index.png",
"selectedIconPath": "images/indexf2.png"
},
{
"pagePath": "pages/movie/movie",
"text": "电影",
"iconPath": "images/movie.png",
"selectedIconPath": "images/movief.png"
},
{
"pagePath": "pages/logs/logs",
"text": "图片",
"iconPath": "images/image.png",
"selectedIconPath": "images/imagef.png"
},
{
"pagePath": "pages/userinfo/userinfo",
"text": "个人中心",
"iconPath": "images/center.png",
"selectedIconPath": "images/centerf.png"
}
]
}
}
微信公众平台的详细讲解地址:https://developers.weixin.qq.com/miniprogram/dev/framework/config.html