WeChat applet hides tabBar
1. There app.json
can list
be no non- tabBar
pages in the content. Simply put, if you don't want this page tabBar
, then tabBar
don't want him.
{
"pages":[
"pages/index/index",
"pages/logs/logs",
"pages/reg/reg"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeChat",
"navigationBarTextStyle":"black"
},
"tabBar": {
"list": [{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "images/home.gif",
"selectedIconPath": "images/home-HL.gif"
}, {
"pagePath": "pages/logs/logs",
"text": "日志",
"iconPath": "images/journal.gif",
"selectedIconPath": "images/journal-HL.gif"
},
// {//这些不能存在
// "pagePath": "pages/reg/reg",
// "text": "登录",
// "iconPath": "images/logo.gif",
// "selectedIconPath": "images/logo-HL.gif"
//}
]
}
}
If you write it accidentally, wx.navigateTo
the fail
callback in the print error is as follows: "navigateTo:fail can not navigate to tabBar page" ie "cannot navigate to tabBar page" .
wx.navigateTo
2. Use functions when needed . For example, when the applet is running, it detects whether the user is logged in. If not, it jumps to the login interface. "`
wx.navigateTo
API official documentation
```
wx.navigateTo({
url:'../reg/reg'
})
The WeChat applet has no hidden tabBar
API, and relies entirely on jumping to achieve it. Which url
is required, pay attention to parameter usage.