Seems like you might be using the old api. Check this tutorial https://vueschool.io/articles/vuejs-tutorials/how-to-use-vue-router-a-complete-tutorial/
Jan 6, 2023
11
Level 4
export 'default' (imported as 'Router') was not found in 'vue-router'
work with vue and Laravel. when I run npm run watch it is occured following error message on my console.
export 'default' (imported as 'Router') was not found in 'vue-router'
My router.js file is
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
import firstPage from './components/pages/myFirstVuePage.vue'
import newRoutePage from './components/pages/newRoutePage.vue'
const routes = [
{
path: '/my-new-vue-route',
component: firstPage
},
{
path: '/new-route',
component: newRoutePage
},
]
export default new Router({
mode: 'history',
routes
})
and app.js
require('./bootstrap');
window.Vue = require('vue')
import router from './router'
Vue.component('mainapp', require('./components/mainapp.vue').dafault)
const app = new Vue({
el: '#app',
router
//store
})
and package.json is
"dependencies": {
"vue": "^3.2.45",
"vue-router": "^4.0.13"
}
how could I fix this problem?
Level 102
Please or to participate in this conversation.