Skip to content

Routing to same url should fire event #2530

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

Closed
plehnen opened this issue Dec 12, 2018 · 1 comment
Closed

Routing to same url should fire event #2530

plehnen opened this issue Dec 12, 2018 · 1 comment

Comments

@plehnen
Copy link

plehnen commented Dec 12, 2018

What problem does this feature solve?

I need to update the current page (request new data from server) whenever the link in the navigation or breadcrumb is clicked. (like it is implemented on amazon)

Currently the router-link will do absolutely nothing when clicked, while already being on the target page.
Neither beforeRouteUpdate or router.beforeEach are triggered.
But it would be nice to be able to notice a route request to the same route.

What does the proposed API look like?

Maybe a beforeRouteReload hook, which returns false per default and does nothing (as it is now), but when it returns true the normal events get fired and I can handle them.

Or a global parameter which allows me to enable events even if from and to are the same. Ideally on route level, individually for each route.

@posva
Copy link
Member

posva commented Dec 12, 2018

Closing in favour of #974

@posva posva closed this as completed Dec 12, 2018
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

No branches or pull requests

2 participants