mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-05-18 11:37:31 +08:00
✨ feat(Play): 完成播放可以根据列表播放 上一首 下一首
This commit is contained in:
@@ -69,6 +69,12 @@ const musicFullClass = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const handlePlay = (item: any) => {
|
||||
const tracks = list.value?.tracks || []
|
||||
const musicIndex = (tracks.findIndex((music: any) => music.id == item.id) || 0)
|
||||
store.commit('setPlayList', tracks.slice(musicIndex))
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@@ -145,7 +151,7 @@ const musicFullClass = computed(() => {
|
||||
:class="setAnimationClass('animate__bounceInUp')"
|
||||
:style="setAnimationDelay(index, 100)"
|
||||
>
|
||||
<SongItem :item="formatDetail(item)" />
|
||||
<SongItem :item="formatDetail(item)" @play="handlePlay"/>
|
||||
</div>
|
||||
</n-layout>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user