aquarius_zzz
2021-12-30 16:55
采纳率: 100%
浏览 788

vue-route4 [Vue Router warn]: No match found for location with path "/home/aa"

使用vue-route4路由嵌套跳转,跳转后页面空白,控制台提示:[Vue Router warn]: No match found for location with path "/home/aa"

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "Home",
    redirect: "/home",
    component: () => import("../views/layouts/Layout.vue"),
    children: [
      {
        path: "/home",
        name: "home",
        component: Home,
        meta: {
          menuShow: true, // 是否在导航栏中显示
          menuName: "首页", // 导航栏中显示的名称
        },
        children: [
          {
            path: "/home/aa",
            name: "about",
            meta: {
              menuShow: true,
              menuName: "关于",
            },
            component: About,
          },
        ],
      },
      {
        path: "/about",
        name: "about",
        meta: {
          menuShow: true,
          menuName: "关于",
        },
        component: () => import("../views/About.vue"),
      },
    ],
  },
];

img

```

2条回答 默认 最新

相关推荐 更多相似问题