天天看点

小程序tabBar的list第一个必须是pages第一个是非必要

小程序的tabBar不显示,搜索出好多讲list第一个必须是pages第一个,可是和需求不匹配,研究发现,tabBar不显示并非因为此,而是因为带有tarBar的页面跳转必须用wx.switchTab,而redirectTo或者navigateTo则不能跳转tabbar绑定过的页面。

{

"pages": [

"pages/index/index",

"pages/login/login",

"pages/home/home",

"pages/myAccount/myAccount"

],

"window": {

"backgroundTextStyle": "light",

"navigationBarBackgroundColor": "#fff",

"navigationBarTitleText": "大城堡",

"navigationBarTextStyle": "black"

},

"tabBar": {

"list": [

{

"pagePath": "pages/home/home",

"text": "首页",

"iconPath": "images/myAccount/limit-icon.png",

"selectedIconPath": "images/myAccount/limit-icon.png"

},

{

"pagePath": "pages/myAccount/myAccount",

"text": "我的",

"iconPath": "images/myAccount/limit-icon.png",

"selectedIconPath": "images/myAccount/limit-icon.png"

}

]

}

}