Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'route' watch triggered after 'created' hook #5

Open
jorups opened this issue Sep 3, 2018 · 7 comments · May be fixed by #18
Open

'route' watch triggered after 'created' hook #5

jorups opened this issue Sep 3, 2018 · 7 comments · May be fixed by #18

Comments

@jorups
Copy link

jorups commented Sep 3, 2018

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.

@Suruat
Copy link
Owner

Suruat commented Sep 5, 2018

@jorups Thank you for a report! I will try to find free time to fix it

@Suruat
Copy link
Owner

Suruat commented Sep 8, 2018

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

@luckydonald
Copy link

luckydonald commented Nov 7, 2018

I think that is the case when breadcrumb is a function, like when the route contains multiple /:variables.

@luckydonald
Copy link

luckydonald commented Nov 7, 2018

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.

@luckydonald
Copy link

luckydonald commented Nov 7, 2018

Also hot reload empties that list.

@rosshulford
Copy link

I get the same behaviour, was there a fix for this?

@Suruat
Copy link
Owner

Suruat commented Mar 4, 2019

@rosshulford No, there wasn't.
Can you provide reproduction link for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants