How could I change RouterView based on params? #2339
-
|
Beta Was this translation helpful? Give feedback.
Answered by
posva
Aug 13, 2024
Replies: 1 comment 2 replies
-
The route {
path: '/my'
children: [
{ path: ':typeId?/:id?' },
]
} Displaying a different component based on the available params is totally fine. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
s3xysteak
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The route
/my/:typeId?/:id?
is a bit ambiguous because of the double optional parameter but it's still realistic in some scenarios. You could avoid the nothing by using a nested route:Displaying a different component based on the available params is totally fine.