Added TrackRow to album page
This commit is contained in:
1 parent
6e54868cc3
commit
1060eeba58
1 file changed
+21
-6
@@ -2,12 +2,11 @@
|
|||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const id = computed(() => route.params.id)
|
const id = computed(() => route.params.id)
|
||||||
|
|
||||||
const {
|
const { data: albumData } = await useApiFetch<Album>(`/albums/${id.value}`)
|
||||||
data: albumData,
|
|
||||||
pending,
|
const { data: tracksData } = await useApiFetch<Track[]>(
|
||||||
error,
|
`/albums/${id.value}/tracks`,
|
||||||
refresh,
|
)
|
||||||
} = await useApiFetch(`/albums/${id.value}`)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -29,6 +28,15 @@ const {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section class="tracks">
|
||||||
|
<TrackRow
|
||||||
|
v-for="(track, i) in tracksData"
|
||||||
|
:key="track._id"
|
||||||
|
:track="track"
|
||||||
|
:index="i"
|
||||||
|
/>
|
||||||
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -38,6 +46,7 @@ const {
|
|||||||
.info {
|
.info {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
|
||||||
& img {
|
& img {
|
||||||
border-radius: $border-radius-standard;
|
border-radius: $border-radius-standard;
|
||||||
@@ -67,4 +76,10 @@ const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tracks {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0.4rem;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in new issue
Block a user