feat: 完善播放列表问题 修复 滚动

This commit is contained in:
alger
2023-12-21 16:45:06 +08:00
parent f81127432e
commit cd11db63eb
5 changed files with 60 additions and 41 deletions
+8
View File
@@ -46,10 +46,18 @@ const mutations = {
state.playList = playList
},
async nextPlay(state: State) {
if (state.playList.length === 0) {
state.play = true
return
}
state.playListIndex = (state.playListIndex + 1) % state.playList.length
await updatePlayMusic(state)
},
async prevPlay(state: State) {
if (state.playList.length === 0) {
state.play = true
return
}
state.playListIndex =
(state.playListIndex - 1 + state.playList.length) % state.playList.length
await updatePlayMusic(state)