how to access router from the store vue 1

how to access router from the store vue

import router from '@/router'

Here is what the above code is Doing:
1. We’re importing Vue from the vue npm package.
2. We’re importing Vuex from the vuex npm package.
3. We’re importing the Vuex store from the store.js file.
4. We’re importing the router from the router.js file.
5. We’re creating a new Vue instance and passing in the store and router.
6. We’re mounting the Vue instance to the #app element.

Similar Posts