[Vuejs]-Vue-router reloading App.vue on every new route

0👍

One approach will be using Navigation Guards when you create a logic to determinate when to make your Ajax calls.

Other will be using Vuex, and create a state object to manage the Ajax calls, dispatch an event when the compontent had been loaded before, and bind a computed property to a getter that will contain the value if that component has been loaded previously.

0👍

Solution was a lot simpler than I thought:

The App.vue page was using a href links hard-coded to each route.
If you switch to using

<router-link to="path to your route">text here</router-link>

instead, everything works as normal – but Vue doesn’t reload the App.vue component!

Leave a comment