Stricter RouterLink props #543
Answered
by
posva
PindaPixel
asked this question in
Q&A
-
Is it possible to get RouterLink to show an error when it has no params passed, but has at least one required param? E.g.: <!-- no error -->
<RouterLink :to="{ name: 'nested/:resource/:id?' }">
Nested route
</RouterLink>
<!-- Property 'resource' is missing in type '{}' but required... -->
<RouterLink :to="{ name: 'nested/:resource/:id?', params: {} }">
Nested route
</RouterLink> I had a case where I did the above and introduced a bug that could have been prevented. |
Beta Was this translation helpful? Give feedback.
Answered by
posva
Nov 21, 2024
Replies: 1 comment
-
It’s not possible yet, but I want to introduce a flag for it. In the future, I will likely remove the default implicit behavior |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
PindaPixel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It’s not possible yet, but I want to introduce a flag for it. In the future, I will likely remove the default implicit behavior