// router.js
import Router from 'vue-router'
import routes from './routes.js'
const router = new Router({
routes
})
export default () => {
return new Router({
mode: 'history',
fallback: true,
routes
})
}
// routes.js
export default [
{
path: '/',
redirect: '/app'
},
{
path: '/app',
component: () => import('./views/todo/todo.vue'),
props: true
},
{
path: '/login',
component: () => import('./views/login/login.vue')
}
]