补充路由

This commit is contained in:
xiaozzzi 2023-11-20 16:43:49 +08:00
parent ab0f7a618d
commit e3855dd01f

View File

@ -13,6 +13,7 @@ const Login = () => import('@/views/index/Login.vue')
const Articles = () => import('@/views/article/Articles.vue')
const TodoIndex = () => import('@/views/todo/TodoIndex.vue')
const PlanIndex = () => import('@/views/plan/PlanIndex.vue')
const NoteIndex = () => import('@/views/note/NoteIndex.vue')
router.addRoute({ path: '/404', component: NotFound })
router.addRoute({ path: '/:pathMatch(.*)', redirect: '/404' })
@ -25,8 +26,9 @@ router.addRoute({
children: [
{ path: '/home', name: 'Home', component: Home, meta: { keepAlive: true } },
{ path: '/login', name: 'Login', component: Login, meta: { keepAlive: true } },
{ path: '/articles', name: 'Articles', component: Articles, meta: { keepAlive: false } },
{ path: '/todo', name: 'TodoIndex', component: TodoIndex, meta: { keepAlive: false } },
{ path: '/plan', name: 'PlanIndex', component: PlanIndex, meta: { keepAlive: false } }
{ path: '/articles', name: 'Articles', component: Articles, meta: { keepAlive: true } },
{ path: '/todo', name: 'TodoIndex', component: TodoIndex, meta: { keepAlive: true } },
{ path: '/plan', name: 'PlanIndex', component: PlanIndex, meta: { keepAlive: false } },
{ path: '/note', name: 'NoteIndex', component: NoteIndex, meta: { keepAlive: false } }
]
})