highlight the selected when you go to folder

This commit is contained in:
geoffrey45
2022-07-09 09:52:46 +03:00
parent 09c588c856
commit 4688665156
9 changed files with 135 additions and 45 deletions
+6 -1
View File
@@ -16,16 +16,21 @@ import FolderList from "@/components/FolderView/FolderList.vue";
import useFStore from "../stores/pages/folder";
import useLoaderStore from "../stores/loader";
import { isSameRoute } from "@/composables/perks";
const loader = useLoaderStore();
const FStore = useFStore();
const scrollable = ref(null);
onBeforeRouteUpdate((to) => {
onBeforeRouteUpdate((to, from) => {
if (isSameRoute(to, from)) return;
loader.startLoading();
FStore.fetchAll(to.params.path as string)
.then(() => {
console.log("fetched");
scrollable.value.scrollTop = 0;
})
.then(() => {
+4 -5
View File
@@ -1,5 +1,5 @@
<template>
<Page :onBottomRaised="fetchAlbumBio">
<Page :bottomRaisedCallback="fetchAlbumBio">
<template #header>
<Header :album="album.info" />
</template>
@@ -13,14 +13,13 @@
</template>
<script setup lang="ts">
import { onBeforeRouteUpdate, RouteLocationNormalized, RouteParams } from "vue-router";
import useAStore from "@/stores/pages/album";
import { onBeforeRouteUpdate, RouteLocationNormalized, RouteParams } from "vue-router";
import Page from "@/layouts/HeaderContentBottom.vue";
import Header from "./Header.vue";
import Content from "./Content.vue";
import Bottom from "./Bottom.vue";
import { onBeforeUnmount } from "vue";
import Content from "./Content.vue";
import Header from "./Header.vue";
const album = useAStore();
-1
View File
@@ -34,7 +34,6 @@ const playlist = usePTrackStore();
onMounted(() => {
playlist.fetchArtists(route.params.pid as string);
});
</script>
<style lang="scss"></style>