vue-2-crumbs
vue-2-crumbs copied to clipboard
'route' watch triggered after 'created' hook
Using 'parentsList' for dynamic breadcrumbs '$route' watch is triggered after 'breadcrumbChanged' event when navigating using router.push/router.replace. As '$route' watch clears 'parentsDynamicRoutes' therefore only current breadcrumb is generated not the full trail.
@jorups Thank you for a report! I will try to find free time to fix it
Hi, @jorups !
Can you provide reproduction link for this issue. As I see, 'breadcrumbChanged' event triggered before and after watcher for $route.
Thank you in advance
I think that is the case when breadcrumb
is a function, like when the route contains multiple /:variables
.
The fix seems to be replacing
watch: {
$route() {
// Set empty component's 'parentsDynamicRoutes' property on each route change
this.parentsDynamicRoutes = [];
},
},
with
beforeRouteUpdate() {
// Set empty component's 'parentsDynamicRoutes' property on each route change
this.parentsDynamicRoutes = [];
},
Edit: Hmm, that doesn't work when jumping to /
home.
Also hot reload empties that list.
I get the same behaviour, was there a fix for this?
@rosshulford No, there wasn't. Can you provide reproduction link for this issue?