const app = getApp() Component({ properties: { active: { type: Number, value: 0, }, }, data: { imageUrl: app.globalData.imageUrl, isChild: 0, active: 0, list: [ { pagePath: '/ground/pages/home/index', text: '首页', icon: 'tab1', iconActive: 'tab1-active', }, { pagePath: '/ground/pages/pharmacist/index', text: '药师管理', icon: 'tab2', iconActive: 'tab2-active', }, { pagePath: '/ground/pages/my/index', text: '我的', icon: 'tab3', iconActive: 'tab3-active', }, ], }, observers: {}, methods: { onChange() {}, handleNav(e) { const { index } = e.currentTarget.dataset const { list } = this.data const { pagePath } = list[index] wx.reLaunch({ url: pagePath, }) }, }, })