From 4b4aaedeef12ae0b4d5a52c6095453ac13a98161 Mon Sep 17 00:00:00 2001 From: ikmkj <1@qq,com> Date: Sat, 26 Jul 2025 11:12:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(music):=20=E5=88=87=E6=8D=A2=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E9=A1=B5=E5=90=8E=E9=87=8D=E7=BD=AE=E9=A1=B5=E7=A0=81?= =?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96=E6=95=B0=E6=8D=AE=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 切换标签页时重置当前页码为第 1 页 - 根据不同的标签页请求对应的数据 - 增加对其他标签页的数据请求处理 --- music-qianduan/src/views/Music.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/music-qianduan/src/views/Music.vue b/music-qianduan/src/views/Music.vue index bd1f816..11a5d10 100644 --- a/music-qianduan/src/views/Music.vue +++ b/music-qianduan/src/views/Music.vue @@ -189,11 +189,13 @@ const fetchLatestMusic = async () => { // 切换标签页 const handleTabChange = (tab) => { - activeTab.value = tab - if (tab === 'hot' && hotMusicList.value.length === 0) { - fetchHotMusic() - } else if (tab === 'latest' && latestMusicList.value.length === 0) { - fetchLatestMusic() + currentPage.value = 1; // 重置页码 + if (tab.paneName === 'hot') { + fetchHotMusic(); + } else if (tab.paneName === 'latest') { + fetchLatestMusic(); + } else { + fetchMusicList(); } }