Assume we have a.vue page component with <nuxt-child>
within. We have b.vue and c.vue dummy components inside the /a/ directory. So we can follow the /a/ link and get the page without nuxt-child, as well as follow /a/b/ and /a/c/ links to get the page with something inside nuxt-child.
Let's add created
and beforeDestroy
hooks to the a.vue component. We see, that every time we go from /a/ to /a/b/ they are triggered. I suppose, this is the incorrect behavior. The root component a.vue should not be reinitialized if we go to the page that does not do anything with it. Even more, I can not add any slide animation to the nuxt-child when it appears because it reinitializes and jumps to the new state constantly.
For example, if we go from /a/b/ to /a/c/, the a.vue compontent does not reinitializes, the hooks are not triggered. That's correct on my sight. If we go from /a/c/ to /a/ - they are triggered once again, and that's what should not happen.
As usual, I created the example repo related to that issue, https://github.com/Kasheftin/nuxt-bug5.
<!--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/c1547">#c1547</a>)</em></sub></div>