vue-router
vue-router copied to clipboard
add the replace attribute in location for hooking in beforeEach
Closes https://github.com/vuejs/vue-router/issues/1620
e... I should to study something about CircleCI now... to be continued.
Hey, sorry for the delay. What are you trying to achieve? The issue you linked is closed. Why are you always setting replace to true if location is an object?
If somebody reset the path in beforeEach, the new path will be open as push type, actually, it will be puzzled if the original router path is replace type.
In this PR, the replace setting of location in the $router.replace() will be set as true, so the developer can find the route's type in the beforeEach hooking.
Aaah, is the issue you're referring to #1620?
yes.
And the vue-router has supported the replace type checking in the route guards next() in this commit: https://github.com/vuejs/vue-router/commit/d53ec3c29a5f05fcb3753b20e12ac37e5546ece2
This pr is an expand of that commit.
ok, could you add some tests to make sure the property is added in different scenarios but not others? (push/replace/calling it with next)
I have added an example for this commit. Hopes to be useful.
Is there any progress? I waiting for this PR to be merged for a long time.
I am waiting for this PR to be merged too..
This will probably come along with other changes that would allow knowing what kind of navigation happened (back, forward, push, replace)
@posva is there any plan to add these features? we are waiting for this feature too too too too too long. almost a year.
Around one year after the last post, I would like to ask if this branch will be merged some day.