Messages: Fix Breadcrumb.vue

pull/4020/head
Julio 3 years ago
parent cd7769ce7a
commit 32ef8817b2
  1. 37
      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,18 +145,17 @@ export default {
});
}
}
}
console.log('legacy');
for (let i = 1, len = matched.length; i < len; i += 1) {
const route = matched[i];
console.log(route.name);
if (route.path) {
items.push({
text: route.name,
disabled: route.path === path || lastItem.path === route.path,
href: route.path
});
}
for (let i = 1, len = matched.length; i < len; i += 1) {
const route = matched[i];
console.log(route.name);
if (route.path) {
items.push({
text: route.name,
disabled: route.path === path || lastItem.path === route.path,
href: route.path
});
}
}

Loading…
Cancel
Save