https://github.com/moltar/route-hooks#readme
git clone [email protected]:moltar/route-hooks.git
cd route-hooks
npm i
npm run dev
open http://localhost:3000/foo/1
console.log outputbeforeRouteUpdate should be called before asyncData
beforeRouteUpdate is called after asyncData
Relevant code chunks:
asyncData is called here:
Routing happens here:
Should it though? Within asyncData you can still decide to redirect to another page, so it makes sense that it runs before the nav guards for the initially intended route are triggered.
To me asyncData is associated with loading of a new page. By that logic any un-loading should happen before that.
I think all other guards come after, but I am just talking about beforeRouteUpdate.
Here's the full router nav flow for reference: https://router.vuejs.org/guide/advanced/navigation-guards.html#the-full-navigation-resolution-flow
Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
Issues that are labeled as pending will not be automatically marked as stale.
It鈥檚 not stale. Still relevant.
Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
Issues that are labeled as pending will not be automatically marked as stale.
This bot is extremely annoying. The issue is not stale.
Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
Issues that are labeled as pending will not be automatically marked as stale.
The issue is not stale.
Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
Issues that are labeled as pending will not be automatically marked as stale.
The issue is not stale.
Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
Issues that are labeled as pending will not be automatically marked as stale.
Stale not
Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
Issues that are labeled as pending will not be automatically marked as stale.
...
Hi @moltar
Actually, you should use the middleware that are called before asyncData instead.