Ошибка в консоли браузера.
router.js?41cb:5 Uncaught TypeError: Cannot read property 'use' of undefined
at eval (router.js?41cb:5)
at Module../src/router.js (app.js:1112)
at __webpack_require__ (app.js:854)
at fn (app.js:151)
at eval (main.js:12)
at Module../src/main.js (app.js:1100)
at __webpack_require__ (app.js:854)
at fn (app.js:151)
at Object.1 (app.js:1149)
Файл main.js
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
createApp(App, router).mount('#app')
Файл router.js
import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/views/Home'
Vue.use(Router)
export default new Router({
mode: 'history',
routes: [
{
path: '/',
component: Home,
},
{
path: '/todos',
component: () => import('./views/Todos.vue'),
},
],
})
Где я ошибся? Как исправить данную ошибку?