File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
src/views/ai/music/components/list Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 6
6
<el-tab-pane v-loading =" loading" label =" 我的创作" name =" mine" >
7
7
<el-row v-if =" mySongList.length" :gutter =" 12" >
8
8
<el-col v-for =" song in mySongList" :key =" song.id" :span =" 24" >
9
- <songCard :songInfo =" song" @click =" setCurrentSong(song)" />
9
+ <songCard :songInfo =" song" @play =" setCurrentSong(song)" />
10
10
</el-col >
11
11
</el-row >
12
12
<el-empty v-else description =" 暂无音乐" />
16
16
<el-tab-pane v-loading =" loading" label =" 试听广场" name =" square" >
17
17
<el-row v-if =" squareSongList.length" v-loading =" loading" :gutter =" 12" >
18
18
<el-col v-for =" song in squareSongList" :key =" song.id" :span =" 24" >
19
- <songCard :songInfo =" song" @click =" setCurrentSong(song)" />
19
+ <songCard :songInfo =" song" @play =" setCurrentSong(song)" />
20
20
</el-col >
21
21
</el-row >
22
22
<el-empty v-else description =" 暂无音乐" />
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" flex bg-[var(--el-bg-color-overlay)] p-12px mb-12px rounded-1" >
3
- <el-image :src =" songInfo.imageUrl" class =" flex-none w-80px" />
3
+ <div class =" relative" @click =" playSong" >
4
+ <el-image :src =" songInfo.imageUrl" class =" flex-none w-80px" />
5
+ <div class =" bg-black bg-op-40 absolute top-0 left-0 w-full h-full flex items-center justify-center cursor-pointer" >
6
+ <Icon :icon =" currentSong.id === songInfo.id ? 'solar:pause-circle-bold':'mdi:arrow-right-drop-circle'" :size =" 30" />
7
+ </div >
8
+ </div >
4
9
<div class =" ml-8px" >
5
10
<div >{{ songInfo.title }}</div >
6
11
<div class =" mt-8px text-12px text-[var(--el-text-color-secondary)] line-clamp-2" >
@@ -20,4 +25,12 @@ defineProps({
20
25
default : () => ({})
21
26
}
22
27
})
28
+
29
+ const emits = defineEmits ([' play' ])
30
+
31
+ const currentSong = inject (' currentSong' , {})
32
+
33
+ function playSong () {
34
+ emits (' play' )
35
+ }
23
36
</script >
You can’t perform that action at this time.
0 commit comments