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(); } }