Added /artist/[id]/tracks
This commit is contained in:
1 parent
f7adfeac22
commit
3aaa3eb42e
2 files changed
+116
-13
No files matched your search
@@ -1,3 +1,42 @@
|
||||
<script setup lang="ts">
|
||||
const route = useRoute()
|
||||
const id = computed(() => route.params.id)
|
||||
|
||||
const { data: tracksData } = await useApiFetch<Track[]>(
|
||||
`/artists/${id.value}/tracks`,
|
||||
)
|
||||
|
||||
const { playAlbumAtIndex } = usePlayer()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<h1>Tracks!</h1>
|
||||
<section class="tracks">
|
||||
<h1 class="title">Songs</h1>
|
||||
|
||||
<TrackRow
|
||||
v-for="(track, i) in tracksData"
|
||||
:key="track._id"
|
||||
:track="track"
|
||||
:index="i"
|
||||
show-image
|
||||
@play-album-at-index="() => playAlbumAtIndex(tracksData, i)"
|
||||
/>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@use "@/styles/util" as *;
|
||||
|
||||
.tracks {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.4rem;
|
||||
}
|
||||
|
||||
.title {
|
||||
@include fontSize(32px);
|
||||
font-weight: 700;
|
||||
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user