这里以mpvue为例子说明一下,基本跟小程序app.json中一样,只是pages数组中第一个字符串去掉’^’
说明几点
- 小程序中新增/减少页面,都需要对 pages 数组进行修改。
- tabBar 是一个数组,只能配置最少2个、最多5个 tab,tab 按数组的顺序排序。
- tabBar 只有在tabBar中配置的页面才显示tabBar,没有在数组中声明的页面不显示tabBar
- 附上abBar的官方链接,详细内容去官网看吧,时间紧没时间写了,抱歉
pages: [
'^pages/index/main',
'pages/product/main',
'pages/login/main',
],
window: {
backgroundTextStyle: 'light',
navigationBarBackgroundColor: '#2C2D31',
navigationBarTitleText: '顾问端',
navigationBarTextStyle: '#fff'
},
"tabBar": {
"selectedColor": "#1296db",
"list": [{
"pagePath": "pages/index/main",
"text": "首页",
// "iconPath": "images/ico-home.png",
// "selectedIconPath": "images/ico-home-d.png"
},{
"pagePath": "pages/order/main",
"text": "设置",
},{
"pagePath": "pages/customer/main",
"text": "帮助",
}]
}