Static GitHub Issues

[1402] Update component before route change

prev: Loading index.html page for the first time ,all routes JS are loaded together
next: Why FuckAdBlock not working on client?

Hi guys,

I am working on my first project with nuxtjs so bare with me.

So I have a layout which has a header component. This component needs to change state/data on route change.

I can watch the route on the layout but I want this to happen before the update of the route so that it is instant ( some animations depend on it ).

Is there a way to do that?

My understanding so far is that this could be done with a middleware and using the store? I am not using the store for this app though, would it make sense to use it only for this specific thing?

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1244">#c1244</a>)</em></sub></div>