diff --git a/music-qianduan/src/views/Playlist.vue b/music-qianduan/src/views/Playlist.vue index 848acf0..a272de9 100644 --- a/music-qianduan/src/views/Playlist.vue +++ b/music-qianduan/src/views/Playlist.vue @@ -44,6 +44,7 @@ const loading = ref(false) // 搜索关键词 const keyword = ref('') +const searchedKeyword = ref('') // 热门歌单 const hotPlaylists = ref([]) @@ -82,7 +83,7 @@ const fetchPlaylists = async () => { const res = await getPlaylistList( currentPage.value, pageSize.value, - keyword.value, + searchedKeyword.value, activeType.value ) @@ -123,6 +124,7 @@ const fetchHotPlaylists = async () => { // 处理搜索 const handleSearch = () => { currentPage.value = 1 + searchedKeyword.value = keyword.value fetchPlaylists() } @@ -243,7 +245,7 @@ onMounted(() => { -