angular路由重定向

路由重定向

路由配置文件中加入以下代码

  {
    path:'str',
    redirectTo:'/home',
    pathMatch:'full'
  },

path为str表示当路由到’/str’时路由地址变为‘/home’ pathMatch表示当完全写入‘/str’时路由才重新定向不可少写漏写

猜你喜欢

转载自blog.csdn.net/weixin_41952198/article/details/81562092
今日推荐