Optional param casted automatically on routerLink even if we don't want optional param (when param is already set in url) #2247
-
Hello I'm not sure this is a bug or perhaps there are wrong stuff in our codebase. Once we set a param to be optional in the routes definition, the Is there a way to prevent that to happening? Example: I have the following links ->
We are using: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
I attempted to reproduce the problem you're seeing based on the examples you gave, but it seemed to be working fine for me: I didn't really understand what you meant about <RouterLink :to="{ ...$route, params: {} }"> |
Beta Was this translation helpful? Give feedback.
I can't really tell what I'm supposed to be looking at in those screenshots.
Perhaps this is what you're looking for?
https://router.vuejs.org/guide/essentials/navigation.html#Navigate-to-a-different-location