use virtual scroll page layout in album page

This commit is contained in:
geoffrey45
2022-09-21 14:57:24 +03:00
committed by Mungai Njoroge
parent 703ea71514
commit 74ea700d93
3 changed files with 35 additions and 12 deletions
+2 -2
View File
@@ -50,7 +50,7 @@ const source = computed(() => queue.tracklist);
// import { focusElem } from "@/utils";
</script>
<style lang="scss">
<!-- <style lang="scss">
.queue-view {
}
</style>
</style> -->
+11 -7
View File
@@ -1,12 +1,9 @@
<template>
<Page>
<Layout :tracks="album.tracks" @playFromPage="playFromAlbum">
<template #header>
<Header :album="album.info" :bio="album.bio" />
</template>
<template #content>
<Content :discs="album.discs" :copyright="album.info.copyright" />
</template>
</Page>
</Layout>
</template>
<script setup lang="ts">
@@ -18,10 +15,11 @@ import {
} from "vue-router";
import Header from "./Header.vue";
import Content from "./Content.vue";
import Page from "@/layouts/HeaderContentBottom.vue";
import Layout from "@/layouts/HeaderAndVList.vue";
import useQueueStore from "@/stores/queue";
const album = useAStore();
const queue = useQueueStore();
onBeforeRouteUpdate(async (to: RouteLocationNormalized) => {
await album
@@ -34,4 +32,10 @@ onBeforeRouteLeave(() => {
album.resetQuery();
}, 500);
});
function playFromAlbum(index: number) {
const { title, artist, hash } = album.info;
queue.playFromAlbum(title, artist, hash, album.allTracks);
queue.play(index);
}
</script>