🐞 fix: 修复播放次序问题

This commit is contained in:
alger
2024-01-04 09:55:41 +08:00
parent 67d42a2291
commit f8efbe8ec6
2 changed files with 3 additions and 2 deletions

View File

@@ -71,7 +71,6 @@ const emits = defineEmits(['play'])
const playMusicEvent = (item: any) => {
store.commit('setPlay', item)
store.commit('setIsPlay', true)
store.state.playListIndex = 0
emits('play', item)
}
</script>

View File

@@ -50,7 +50,9 @@ const mutations = {
state.play = play
},
setPlayList(state: State, playList: SongResult[]) {
state.playListIndex = 0
state.playListIndex = playList.findIndex(
(item) => item.id === state.playMusic.id
)
state.playList = playList
},
async nextPlay(state: State) {