Add static part before optional parameter? #2495
Unanswered
hackel
asked this question in
Help and Questions
Replies: 1 comment
-
Adding an alias without the parameter should work |
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
-
I've been trying to come up with a way to have an optional parameter proceeded by an identifying static part. e.g.
What I'm after is for
/a/123
and/a/123/b/456
to point to the same route, without having to duplicate the route definition. Is there any way to achieve this? Also, I would need to be able to navigate to the static part of the route with{ name: 'my.route.name', params: { a: 123, b: 456 } }
. I have a whole series of routes that I need to add this optional parameter to, and I don't want to have to repeat the route definition for them all. Note that/a/123/b
should not be valid in this case.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions