中等Vue路由
0 1

Vue Router 中如何获取路由传递过来的参数?

【概念释义】

路由参数:params(路径 /user/:id$route.params)、query?page=1$route.query)、props 映射meta 静态配置。组件内 readonly $route

【基础使用】

javascript
"qb-hl-comment">// /user/5?tab=info
this.$route.params.id;  "qb-hl-comment">// "5"
this.$route.query.tab;  "qb-hl-comment">// "info"
this.$route.meta.requiresAuth;

【版本差异】

登录查看完整 624

回答讨论

暂无讨论,登录后可抢先发言

本题库更多题目(50)