Component({
  data: {
    selected: "/pages/index/index",
    list: [{
        "pagePath": "/pages/index/index",
        "text": "首页",
        "icon": "home"
      },
      {
        "pagePath": "/pages/examples/index",
        "text": "品牌",
        "icon": "building-1"
      },
      {
        "pagePath": "/pages/user-center/index",
        "text": "我的",
        "icon": "user"
      }
    ]
  },
  ready() {
    const cp = getCurrentPages()
    console.log(cp[cp.length-1].route)
    this.setData({selected:`/${cp[cp.length-1].route}`})
  },
  methods: {
    switchTab(e) {
      const path = e.detail.value
      wx.switchTab({
        url: path
      })
    }
  }
})