// monitor/pages/components/tabBar/tabBar.js Component({ /** * 组件的属性列表 */ properties: { url: String, active: { type:Number, value:0 } }, /** * 组件的初始数据 */ data: { // active: 0 }, /** * 组件的方法列表 */ methods: { onChange(e){ this.setData({ active: e.detail }); if (e.detail == '0') {//首页 wx.reLaunch({ url: '/monitor/pages/home/home', }) }else if(e.detail == '1'){//电站 wx.reLaunch({ url: '/monitor/pages/station/station', }) }else if(e.detail == '2'){//我的 wx.reLaunch({ url: '/monitor/pages/center/center', }) } } } })