fe-interview icon indicating copy to clipboard operation
fe-interview copied to clipboard

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

Open haizhilin2013 opened this issue 7 years ago • 3 comments

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

haizhilin2013 avatar Jun 20 '19 20:06 haizhilin2013

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

ihouchunyao avatar Oct 23 '19 07:10 ihouchunyao

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

WenJieLi1998 avatar Apr 19 '20 01:04 WenJieLi1998

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

lt846786463 avatar Oct 09 '20 06:10 lt846786463