动态路由匹配
模式 | 匹配路径 | $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