Please take a look at the fiddle
https://jsfiddle.net/L3px7okf/
I want to reload the app when the same route (for example /foo
) which you are currently on is clicked again because I need to reset the page state (yes, the correct way would be, actually, to reset the state, but the application code is a bit tricky thus I need a quick solution).
But I don't want to reload the app when I'm clicking /foo
being on route /bar
.
The problem is that VueRouter
does nothing when the same link is clicked. Global (like beforeEach
) and in-component (like beforeRouterEnter
/beforeRouteLeave
) hooks are not called. @onclick.native
event handling doesn't help because when the handler is executed the route is already updated.