Skip to content

How could I change RouterView based on params? #2339

Closed Answered by posva
s3xysteak asked this question in Help and Questions
Discussion options

You must be logged in to vote

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:

{
  path: '/my'
  children: [
    { path: ':typeId?/:id?' },
  ]
}

Displaying a different component based on the available params is totally fine.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@s3xysteak
Comment options

@posva
Comment options

Answer selected by s3xysteak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants