vue命名路由(name)的作用

命名路由:

  {
    path: '/about',
    name: 'about',
    component: About
  }

作用:

  1、路由跳转

  this.$router.push({ name: 'about' })

  2、路由重定向

  {
    path: '/a',
    redirect: {
      // path: '/about'
      name: 'about'
    }
  }

 

上一篇:2021-09-07


下一篇:10 Things Every Java Programmer Should Know About Ruby