Made small architectural change for TrackRow
This commit is contained in:
1 parent
1060eeba58
commit
6c10a53a75
1 file changed
+6
-3
@@ -8,6 +8,7 @@ interface TrackRowProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { track, index, extendedInfo } = defineProps<TrackRowProps>()
|
const { track, index, extendedInfo } = defineProps<TrackRowProps>()
|
||||||
|
const emit = defineEmits<{ (e: "playAlbumAtIndex"): void }>()
|
||||||
|
|
||||||
const hovering = ref(false)
|
const hovering = ref(false)
|
||||||
|
|
||||||
@@ -38,8 +39,6 @@ const dropdownMenuItems: DropdownMenuItem[] = [
|
|||||||
const durationFormatted = computed(() =>
|
const durationFormatted = computed(() =>
|
||||||
new Date(track.durationInSeconds * 1000).toISOString().slice(14, 19),
|
new Date(track.durationInSeconds * 1000).toISOString().slice(14, 19),
|
||||||
)
|
)
|
||||||
|
|
||||||
const play = () => {}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -50,7 +49,11 @@ const play = () => {}
|
|||||||
@mouseleave="hovering = false"
|
@mouseleave="hovering = false"
|
||||||
>
|
>
|
||||||
<div class="index">
|
<div class="index">
|
||||||
<Icon name="lucide:play" @click="play" v-if="hovering" />
|
<Icon
|
||||||
|
name="lucide:play"
|
||||||
|
@click="emit('playAlbumAtIndex')"
|
||||||
|
v-if="hovering"
|
||||||
|
/>
|
||||||
<p v-else>{{ index + 1 }}</p>
|
<p v-else>{{ index + 1 }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user