From 99dfeb5fc86bce593a5d3f43f45c26eedc00ab0a Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期二, 10 九月 2024 16:28:54 +0800 Subject: [PATCH] bug --- custom-tab-bar/index.js | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-) diff --git a/custom-tab-bar/index.js b/custom-tab-bar/index.js index aa4b9cd..edef97d 100644 --- a/custom-tab-bar/index.js +++ b/custom-tab-bar/index.js @@ -1,18 +1,15 @@ import TabMenu from './data'; Component({ data: { - selected: 0, + active: 0, list: TabMenu, }, methods: { changeTab(item) { - this.setData({ - selected: item.currentTarget.dataset.num - }) wx.switchTab({ - url: this.data.list[this.data.selected].url.startsWith('/') ? - this.data.list[this.data.selected].url : `/${this.data.list[this.data.selected].url}`, + url: this.data.list[item.currentTarget.dataset.num].url.startsWith('/') ? + this.data.list[item.currentTarget.dataset.num].url : `/${this.data.list[item.currentTarget.dataset.num].url}`, }); } }, -}); +}); \ No newline at end of file -- Gitblit v1.9.1