微信小程序tabBar底部导航 不显示问题解析

  1. 直接上代码:

    出不来的代码:

    [html]  view plain  copy
    1. {  
    2.   "pages": [  
    3.     "pages/splash/splash",  
    4.     "pages/zhuye/zhuye",  
    5.     "pages/list/list",  
    6.     "pages/item/item",  
    7.     "pages/search/search",  
    8.     "pages/profile/profile"  
    9.   ],  
    10.   "window": {  
    11.     "navigationBarBackgroundColor": "#35495e",  
    12.     "navigationBarTextStyle": "white",  
    13.     "navigationBarTitleText": "电影 « 豆瓣",  
    14.     "backgroundColor": "#fff",  
    15.     "backgroundTextStyle": "dark",  
    16.     "enablePullDownRefresh": true  
    17.   },  
    18.   "tabBar": {  
    19.      
    20.     "list": [  
    21.       {  
    22.           
    23.         "pagePath":  "pages/zhuye/zhuye",  
    24.         "iconPath": "images/board.png",  
    25.         "selectedIconPath": "images/board-actived.png",  
    26.         "text": "榜单"  
    27.       },  
    28.       {  
    29.          
    30.         "pagePath": "pages/search/search",  
    31.         "iconPath": "images/search.png",  
    32.         "selectedIconPath": "images/search-actived.png",  
    33.          "text": "搜索"  
    34.       },  
    35.       {  
    36.           
    37.         "pagePath": "pages/profile/profile",  
    38.         "iconPath": "images/profile.png",  
    39.         "selectedIconPath": "images/profile-actived.png",  
    40.         "text": "我的"  
    41.       }  
    42.     ]  
    43.   },  
    [html]  view plain  copy
    1.   
    [html]  view plain  copy
    1. "color": "#ccc",  
    2. "selectedColor": "#35495e",  
    3. "borderStyle": "white",  
    4. "backgroundColor": "#f9f9f9",  
    "networkTimeout": { "request": 10000, "connectSocket": 10000, "uploadFile": 10000, "downloadFile": 10000 }, "debug": true}

    解决方案一:把  tabBar配置中的    "pagePath":  "pages/zhuye/zhuye", 换成 配置为首页的pages/splash/splash 就可以了;

    方案二:完美解决方案  

    在wxml里 加入  open-type="switchTab"

    [html]  view plain  copy
    1. <navigator url="../zhuye/zhuye" open-type="switchTab" >  
    2.           <button class="btn" bindtap="start" wx:if="{{index == movies.length - 1}}" >立即体验</button>  
    3.      </navigator>  

    方案三: 

     js里面用这个跳转带bar的页面 


猜你喜欢

转载自blog.csdn.net/qq_41813695/article/details/80413408