Skip to content Skip to sidebar Skip to footer

How Can I Show Loading Spinner When Changing Router In Vue 2

I have been trying to show a spinner on each router change in vue 2. I added a flag in created method to show the initial loading and after sometime I stopped the loading spinner.

Solution 1:

You can also use navigation guards to set a beforeEach method that will run before entering each new route: https://router.vuejs.org/en/advanced/navigation-guards.html


Post a Comment for "How Can I Show Loading Spinner When Changing Router In Vue 2"