mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-24 16:27:23 +08:00
🐞 fix: 修复播放次序问题
This commit is contained in:
@@ -71,7 +71,6 @@ const emits = defineEmits(['play'])
|
|||||||
const playMusicEvent = (item: any) => {
|
const playMusicEvent = (item: any) => {
|
||||||
store.commit('setPlay', item)
|
store.commit('setPlay', item)
|
||||||
store.commit('setIsPlay', true)
|
store.commit('setIsPlay', true)
|
||||||
store.state.playListIndex = 0
|
|
||||||
emits('play', item)
|
emits('play', item)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
+3
-1
@@ -50,7 +50,9 @@ const mutations = {
|
|||||||
state.play = play
|
state.play = play
|
||||||
},
|
},
|
||||||
setPlayList(state: State, playList: SongResult[]) {
|
setPlayList(state: State, playList: SongResult[]) {
|
||||||
state.playListIndex = 0
|
state.playListIndex = playList.findIndex(
|
||||||
|
(item) => item.id === state.playMusic.id
|
||||||
|
)
|
||||||
state.playList = playList
|
state.playList = playList
|
||||||
},
|
},
|
||||||
async nextPlay(state: State) {
|
async nextPlay(state: State) {
|
||||||
|
|||||||
Reference in New Issue
Block a user