Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vue] 在vue组件中怎么获取到当前的路由信息? #377

Open
haizhilin2013 opened this issue Jun 20, 2019 · 5 comments
Open

[vue] 在vue组件中怎么获取到当前的路由信息? #377

haizhilin2013 opened this issue Jun 20, 2019 · 5 comments
Labels
vue vue

Comments

@haizhilin2013
Copy link
Collaborator

[vue] 在vue组件中怎么获取到当前的路由信息?

@haizhilin2013 haizhilin2013 added the vue vue label Jun 20, 2019
@miqidian
Copy link

miqidian commented Aug 6, 2019

this.$router.path 或者 this.$router

@Real102
Copy link

Real102 commented Sep 27, 2019

this.$router.path 或者 this.$router

是this.$route.path吧

@liuxiaoyang1
Copy link

this.$router.path 或者 this.$router

是this.$route.path吧

对,

@zlqGitHub
Copy link

zlqGitHub commented Dec 23, 2019

如果是template中获取直接 $route 即可
如果是script中获取 this.$route
可以 console.log(this.$route) 查看其详细信息

@WenJieLi1998
Copy link

this.$route

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vue vue
Projects
None yet
Development

No branches or pull requests

6 participants