微信小程序-tabbar

微信小程序使用自带的tabbar

//app.json 配置
"tabBar": {
  "color": "#4a4a4a",
  "selectedColor": "#EA4F20",
  "backgroundColor": "#fff",
  "borderStyle": "white",
  "position": "bottom",
  "list": [
    {
      "pagePath": "pages/index/index",
      "text": "美刻",
      "selectedIconPath": "/images/[email protected]",
      "iconPath": "/images/[email protected]"
    },
    {
      "pagePath": "pages/Message/Message",
      "text": "消息",
      "selectedIconPath": "/images/[email protected]",
      "iconPath": "/images/[email protected]"
    },
    {
      "pagePath": "pages/My/My",
      "text": "我的",
      "selectedIconPath": "/images/[email protected]",
      "iconPath": "/images/[email protected]"
    }
  ]
}

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

wx.switchTab({
  url: '/pages/index/index'
})

你可能感兴趣的:(微信小程序-tabbar)