Skip to content

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

Open
@haizhilin2013

Description

@haizhilin2013
Collaborator

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

Activity

ihouchunyao

ihouchunyao commented on Oct 23, 2019

@ihouchunyao

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

WenJieLi1998

WenJieLi1998 commented on Apr 19, 2020

@WenJieLi1998

路径:{ 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

lt846786463 commented on Oct 9, 2020

@lt846786463
path:"" 或者redirect:"地址"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @haizhilin2013@WenJieLi1998@lt846786463@ihouchunyao

        Issue actions

          [vue] vur-router怎么重定向? · Issue #376 · haizlin/fe-interview