0👍
the Router
needs to be supplied to Vue
during initialization, explicitly:
new Vue({
router: Router
})
Where Router
is your import Router from '...path'
.
0👍
In Main.js file do the following thing:
import router from './router'
where ‘./router’ would be the path of your router file.
then,
new Vue({
el: '#app',
router,
template: '<App/>',
components: {
App
},
data() {
return {}
}
})
Than, supply it to the Vue in the same file (Main.js). HAPPY CODING 🙂
Source:stackexchange.com