// pages/component/foot-tab.js Component({ /** * 组件的属性列表 */ properties: { value: { type: String, value: null } }, lifetimes: { created() { }, attached: function () { // 在组件实例进入页面节点树时执行 }, detached: function () { // 在组件实例被从页面节点树移除时执行 }, }, /** * 组件的初始数据 */ data: { list: [ { value: 'label_1', icon: 'home', ariaLabel: '首页' }, { value: 'label_2', icon: 'chart', ariaLabel: '统计' }, { value: 'label_3', icon: 'creditcard', ariaLabel: '资产' }, { value: 'label_4', icon: 'user', ariaLabel: '我的' }, ], }, /** * 组件的方法列表 */ methods: { setIconData(cur){ if (cur == 'label_1'){ wx.redirectTo({ url: '../index/index' }) } if (cur == 'label_2'){ wx.redirectTo({ url: '../chart/index' }) } if (cur == 'label_3'){ wx.redirectTo({ url: '../account/index' }) } if (cur == 'label_4'){ wx.redirectTo({ url: '../myself/index' }) } }, onChange(event) { this.setIconData(event.detail.value); }, } })