WeChat applet hides tabBar

WeChat applet hides tabBar

1. There app.jsoncan listbe no non- tabBarpages in the content. Simply put, if you don't want this page tabBar, then tabBardon'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.navigateTothe failcallback in the print error is as follows: "navigateTo:fail can not navigate to tabBar page" ie "cannot navigate to tabBar page" .

wx.navigateTo2. 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 tabBarAPI, and relies entirely on jumping to achieve it. Which urlis required, pay attention to parameter usage.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325384226&siteId=291194637