报错[vue-router] Duplicate named routes definition: { name: “Home”, path: “/home” }warn @ vue-router.esm.js?8c4f:16如何解决?

报错原因:

  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/home',
    name: 'Home',
    component: Home
  },

路由名称重复

解决方案:

  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/home',
    name: 'Home2',
    component: Home
  },
Logo

前往低代码交流专区

更多推荐