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

vue-router4 路由严格匹配模式,Sensitive 与 strict 路由配置_vue.js

https://router.vuejs.org/zh/guide/essentials/route-matching-syntax.html

vue-router4 路由严格匹配模式,Sensitive 与 strict 路由配置_javascript_02