Nested relative redirects #2013
Replies: 1 comment
-
Duplicate of #2014 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm migrating from Vue2 and having hard times with nested redirects as there seem to be a breaking change that I can't find mention of anywhere.
In VueRouter v3 it was possible to use a relative redirect (no leading slash in the redirect path) and if redirected to a child path, the path was concatenating like "parentPath/childPath".
Seems like this is no longer how it works in VueRouter v4 which brings tons of troubles in our application as we were heavily relying of that logic before, so I hope for advice.
Consider the following example:
Router v3 behaviour (expected):
/app
-> redirects to/app/dashboard
/app/dashboard
-> redirects to/app/dashboard/list
/app/dashboard/list
-> redirects to/app/dashboard/list/sublist
/app
user ends up at/app/dashboard/list/sublist
which is expectedRouter v4 behaviour (incorrect):
/app
-> redirects to/dashboard/list
redirect: 'dashboard/list'
is changed toredirect: 'app/dashboard/list'
then it goes one step deeper but redirects to /list/sublist and then 404In Router v3 when there is a trailing slash in redirect, it would give the same behaviour. So it seems like relative redirects are no longer supported in v4, is this correct?
Any suggestions/workarounds to make the relative nested redirects to still concatenate paths?
Beta Was this translation helpful? Give feedback.
All reactions