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] vur-router怎么重定向? #376

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

[vue] vur-router怎么重定向? #376

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

Comments

@haizhilin2013
Copy link
Collaborator

[vue] vur-router怎么重定向?

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

{
path:'/goback',
redirect:'/'
}

@WenJieLi1998
Copy link

路径:{ path: '/a', redirect: '/b' }
命名的路由: { path: '/a', redirect: {name:'/foo'} }
动态重定向目标: { path: '/a', redirect: to => {
const {
query,
params,
hash
} = to
if (params.name) {
return /${params.name}
} else if (query.to && query.to === "bar") {
return /${query.to}
} else if (hash === '#baz') {
return '/baz'
}
}
}

@lt846786463
Copy link

path:"" 或者redirect:"地址"

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

4 participants