mirror of
https://github.com/Tencent/tdesign-vue-next-starter.git
synced 2024-11-10 07:28:24 +08:00
feat(Router): 路由跳转携带参数 (#720)
Co-authored-by: suxue <admin@moyiyang.cn>
This commit is contained in:
parent
0aa81be9a6
commit
6e0560f69d
|
@ -39,7 +39,7 @@ router.beforeEach(async (to, from, next) => {
|
||||||
next({ path: to.fullPath, replace: true, query: to.query });
|
next({ path: to.fullPath, replace: true, query: to.query });
|
||||||
} else {
|
} else {
|
||||||
const redirect = decodeURIComponent((from.query.redirect || to.path) as string);
|
const redirect = decodeURIComponent((from.query.redirect || to.path) as string);
|
||||||
next(to.path === redirect ? { ...to, replace: true } : { path: redirect });
|
next(to.path === redirect ? { ...to, replace: true } : { path: redirect, query: to.query });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user