folder: fix breadcrumb navigation (fix #731)

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/767/head
Varun Patil 2023-07-21 20:53:04 -07:00
parent 33eada84a0
commit 10783a7cd1
1 changed files with 6 additions and 7 deletions

View File

@ -8,7 +8,7 @@
</NcBreadcrumb>
<NcBreadcrumb
v-for="folder in list"
:key="folder.path"
:key="folder.idx"
:title="folder.text"
:to="{ name: 'folders', params: { path: folder.path } }"
/>
@ -67,7 +67,8 @@ export default defineComponent({
computed: {
list(): {
text: string;
path: string;
path: string[];
idx: number;
}[] {
let path: string[] | string = this.$route.params.path || '';
if (typeof path === 'string') {
@ -76,11 +77,9 @@ export default defineComponent({
return path
.filter((x) => x)
.map((x, idx, arr) => {
return {
text: x,
path: arr.slice(0, idx + 1).join('/'),
};
.map((text, idx, arr) => {
const path = arr.slice(0, idx + 1);
return { text, path, idx };
});
},