reserve entered paths on navigating back

- retain the list of entered folders on going up the directory tree. 😹
This commit is contained in:
geoffrey45
2022-06-08 15:54:51 +03:00
parent 84bf467d9f
commit 14364a1257
4 changed files with 60 additions and 14 deletions
+3 -3
View File
@@ -43,15 +43,15 @@ function useSubRoutes() {
(newRoute: string) => {
switch (newRoute) {
case Routes.folder:
console.log(newRoute);
subPaths.value = createSubPaths(route.params.path);
let oldpath = "";
[oldpath, subPaths.value] = createSubPaths(route.params.path, oldpath);
watch(
() => route.params.path,
(newPath) => {
if (newPath == undefined) return;
subPaths.value = createSubPaths(newPath);
[oldpath, subPaths.value] = createSubPaths(newPath, oldpath);
}
);
break;
+10 -2
View File
@@ -2,7 +2,6 @@
<div id="folder-nav-title">
<div
class="folder"
v-motion
:initial="{
opacity: 0,
@@ -19,7 +18,12 @@
<div class="fname">
<div class="icon image"></div>
<div class="paths">
<div class="path" v-for="path in subPaths" :key="path.path">
<div
class="path"
v-for="path in subPaths"
:key="path.path"
:class="{ current: path.active }"
>
<span class="text">{{ path.name }}</span>
</div>
</div>
@@ -120,6 +124,10 @@ defineProps<{
}
}
}
.current > .text {
background-color: $accent;
}
}
}
}