Skip to content

Commit

Permalink
folder: fix breadcrumb navigation (fix #731)
Browse files Browse the repository at this point in the history
Signed-off-by: Varun Patil <radialapps@gmail.com>
  • Loading branch information
pulsejet committed Jul 22, 2023
1 parent 33eada8 commit 10783a7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/components/top-matter/FolderTopMatter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 } }"
/>
Expand Down Expand Up @@ -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') {
Expand All @@ -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 };
});
},
Expand Down

0 comments on commit 10783a7

Please sign in to comment.