模式 匹配路径 $route.params
/user/:username /user/evan {username:'evan'}
/user/:username/post/:post_id /user/evan/post/123 {username:'evan',post_id:123}

 

 

 

 

 

 

使用方法:

第一种/user/:username:

index.js:

     动态路由匹配

GoodsList.vue:

    动态路由匹配

在浏览器中访问:localhost:8080/goods/goodId

  动态路由匹配

第二种:/user/:username/post/:post_id

index.jsp:

    动态路由匹配

GoodsList.vue:

    动态路由匹配

在浏览器中输入localhost:8080/goods/goodId/user/name

动态路由匹配

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
猜你喜欢
  • 2021-11-26
  • 2021-08-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-10
  • 2022-12-23
相关资源
相似解决方案