vue获取当前路由

完整url可以用 window.location.href
路由路径可以用 this.$route.path
路由路径参数 this.$route.params 例如:/user/:id → /user/2044011030 → this.$route.params.id
路由查询参数 this.$route.query 例如:/user/search?name=sf → this.$route.query.name

原文链接:https://blog.csdn.net/a350110085/article/details/90053111

本文仅提供参考,是本人闲时所写笔记,如有错误,还请赐教,作者:阿蒙不萌,大家可以随意转载

原文地址:https://www.cnblogs.com/huchong-bk/p/12047978.html