fe-interview
fe-interview copied to clipboard
[vue] 在vue组件中怎么获取到当前的路由信息?
[vue] 在vue组件中怎么获取到当前的路由信息?
this.$router.path 或者 this.$router
this.$router.path 或者 this.$router
是this.$route.path吧
this.$router.path 或者 this.$router
是this.$route.path吧
对,
如果是template中获取直接 $route 即可
如果是script中获取 this.$route
可以 console.log(this.$route) 查看其详细信息
this.$route