-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
In the afterEach hook, the query of loaction.href != to.fullPath #1197
Comments
@yyx990803 Was this on purpose? I can submit the fix by moving the hooks call out of |
Is there a reaction to this? My situation: |
I forgot about this but it's not a problem at the moment because you can get the router.afterEach((to, from) => {
console.log('from', from.fullPath)
console.log('to', to.fullPath)
console.log('location.href' + location.host + to.fullPath) // instead of location.href
}) I suppose changing the location is not done yet in case you want to redirect or replace the location in the |
I read the vue-router's documents again, and according to it, global Second, as I can learn from the docs, global beforeEach callbacks are repected as guards(so its callback has a third parameter What I means is that in doc link: https://router.vuejs.org/en/advanced/navigation-guards.html |
and another thing, location.href = protocol + host + path |
I don't understand why this was closed @posva What are we supposed to listen to to know the url is settled? The TO object is useless to third parties like Google Analytics, BoldChat, Drift etc.. They look at window.location and at this point (afterEach) the url has NOT changed. |
"vue": "^2.1.0",
"vue-router": "^2.0.1",
https://jsfiddle.net/warden__/t59wecc5/
In the 1.x it works well
The text was updated successfully, but these errors were encountered: