Component({ properties: { active: { type: String, value: 'home' } // 'home' | 'category' | 'mine' }, data: { items: [ { key: 'home', label: '首页', icon: 'home', page: '/pages/index/index' }, { key: 'category', label: '分类', icon: 'layout-grid', page: '/pages/category/category' }, { key: 'plans', label: '计划', icon: 'clipboard-list', page: '/pages/my-plans/my-plans' }, { key: 'mine', label: '我的', icon: 'user', page: '/pages/profile/profile' } ] }, methods: { onTap(e) { const page = e.currentTarget.dataset.page; if (!page) return; // 使用 reLaunch 重置页面栈,避免页面层级堆叠 wx.reLaunch({ url: page }); } } });