mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-23 23:57:22 +08:00
✨ feat: 添加播放历史页面
This commit is contained in:
@@ -45,6 +45,7 @@
|
||||
import { useStore } from 'vuex'
|
||||
import type { SongResult } from '@/type/music'
|
||||
import { getImgUrl } from '@/utils'
|
||||
import { useMusicHistory } from '@/hooks/MusicHistoryHook'
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
item: SongResult
|
||||
@@ -66,12 +67,15 @@ const isPlaying = computed(() => {
|
||||
|
||||
const emits = defineEmits(['play'])
|
||||
|
||||
const musicHistory = useMusicHistory()
|
||||
|
||||
// 播放音乐 设置音乐详情 打开音乐底栏
|
||||
const playMusicEvent = (item: any) => {
|
||||
store.commit('setPlay', item)
|
||||
store.commit('setIsPlay', true)
|
||||
store.state.playListIndex = 0
|
||||
emits('play', item)
|
||||
musicHistory.addMusic(item)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user