【小程序开发】微信小程序开发中遇到的那些坑...

第一坑:

设置了三个tabBar,却默认显示第二个,不能展示我的第一个【首页】。

    "list": [{
        "pagePath":"page/KTGJ/index/index",
        "iconPath":"image/icon_component.png",
        "selectedIconPath": "image/icon_component_HL.png",
        "text": "首页"
      }, {
      "pagePath": "page/component/index",
      "iconPath": "image/icon_component.png",
      "selectedIconPath": "image/icon_component_HL.png",
      "text": "组件"
    }, {
      "pagePath": "page/API/index/index",
      "iconPath": "image/icon_API.png",
      "selectedIconPath": "image/icon_API_HL.png",
      "text": "接口"
    }]

原因:

tabBar的list的pagePath指定的页面没有写在注册页面第一个。
微信小程序的逻辑是"pages"中的第一个页面是首页,也就是程序启动后第一个显示的页面,
如果tabBar的list的pagePath指定的页面都不是pages的第一个,当然也就不会电视tabBar了。

 

posted @ 2016-11-10 10:22  李0539  阅读(4283)  评论(1编辑  收藏  举报