小程序首頁不顯示tabbar


代碼:

{
  "pages":[
    "pages/index/index",
    "pages/swipe/swipe",
    "pages/movies/movies",
    "pages/swipe/swipe-detail/swipe-detail",
    "pages/logs/logs"
  ],
  "requiredBackgroundModes": [
    "audio"
  ],
  "window":{
    "backgroundTextStyle":"light",
    "navigationBarBackgroundColor": "#405f80",
    "navigationBarTitleText": "WeChat",
    "navigationBarTextStyle":"black"
  },
  "tabBar": {
    "borderStyle": "white",
    "position": "bottom",
    "list": [
      {
        "pagePath": "pages/index/index",
        "text": "首頁",
        "iconPath": "images/tab/ciwei.png",
        "selectedIconPath": "images/tab/ciwei_hl.png"
      },
      {
        "pagePath": "pages/swipe/swipe",
        "text": "閱讀",
        "iconPath": "images/tab/yuedu.png",
        "selectedIconPath": "images/tab/yuedu_hl.png"
      },
      {
        "pagePath": "pages/movies/movies",
        "text": "電影",
        "iconPath": "images/tab/dianying.png",
        "selectedIconPath": "images/tab/dianying_hl.png"
      }
    ]
  }
}

注意:

pages/index/index   這個路徑 跟 list 的 第一個對象的路徑相同

跳轉到tabar 選項頁面:

 //打開一個新頁面
    wx.switchTab({
      url: '../swipe/swipe',
    })

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM