Messages: Fix Breadcrumb.vue

pull/4020/head
Julio 3 years ago
parent cd7769ce7a
commit 32ef8817b2
  1. 19
      assets/vue/components/Breadcrumb.vue

@ -53,8 +53,17 @@ export default {
'MySessionListUpcoming',
'MySessionListPast',
'Home',
'MessageList',
];
if (this.$route.name.includes('Message')) {
items.push({
text: this.$t('Messages'),
//disabled: route.path === path || lastItem.path === route.path,
href: '/resources/messages'
});
}
if (list.includes(this.$route.name)) {
return items;
}
@ -97,7 +106,6 @@ export default {
// course is set in documents/List.vue
if (this.course) {
console.log('copursssss');
// First node
items.push({
text: this.course.title,
@ -106,14 +114,16 @@ export default {
}
console.log(items);
const { path, matched } = this.$route;
const lastItem = matched[matched.length - 1];
if (this.resourceNode) {
console.log('resourceNode');
console.log(this.resourceNode);
console.log(this.resourceNode.path);
const parts = this.resourceNode.path.split('/');
const { path, matched } = this.$route;
const lastItem = matched[matched.length - 1];
for (let i = 0, len = parts.length; i < len; i += 1) {
let route = parts[i];
@ -135,8 +145,8 @@ export default {
});
}
}
}
console.log('legacy');
for (let i = 1, len = matched.length; i < len; i += 1) {
const route = matched[i];
console.log(route.name);
@ -148,7 +158,6 @@ export default {
});
}
}
}
console.log('BREADCRUMB');
console.log(items);

Loading…
Cancel
Save