微信小程序-tabbar

2018-03-20  本文已影响0人  ismyshellyiqi

微信小程序使用自带的tabbar

//app.json 配置
"tabBar": {
  "color": "#4a4a4a",
  "selectedColor": "#EA4F20",
  "backgroundColor": "#fff",
  "borderStyle": "white",
  "position": "bottom",
  "list": [
    {
      "pagePath": "pages/index/index",
      "text": "美刻",
      "selectedIconPath": "/images/selectedDemo00@3x.png",
      "iconPath": "/images/demo01@3x.png"
    },
    {
      "pagePath": "pages/Message/Message",
      "text": "消息",
      "selectedIconPath": "/images/selectedDemo01@2x.png",
      "iconPath": "/images/demo01@2x.png"
    },
    {
      "pagePath": "pages/My/My",
      "text": "我的",
      "selectedIconPath": "/images/selectedDemo02@2x.png",
      "iconPath": "/images/demo01@3x.png"
    }
  ]
}

在跳转到某个tab页面时,只能使用

wx.switchTab({
  url: '/pages/index/index'
})
上一篇下一篇

猜你喜欢

热点阅读