import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: '/',
redirect: '/home',
},
{
path: '/index/home',
component: () => import('../views/index/Home.vue'),
},
{
path: '/home',
component: () => import('../views/home/Index.vue'),
},
{
path: '/me',
component: () => import('../views/me/Index.vue'),
sensitive: true
},
{
path: '/404',
component: () => import('../views/notFound/Index.vue')
},
{
path: '/:catchAll(.*)',
redirect: '/404'
}
],
})
export default router
https://router.vuejs.org/zh/guide/essentials/route-matching-syntax.html