props: true with nested routes
#2179
skirtles-code
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Related: #1191.
I encountered this problem on Vue Land. Example:
The key things to note are:
props: truebecause it wantsusernameto be passed as a prop.propsbecause it wants to convertidto a number.The reason this happens is because the
idprop is being passed to the parent. It ends up inattrs. These are then being inherited by the root-level<RouterView />in the parent, passingiddown to the child. This then overrides the prop coming from Vue Router.On the one hand, this is behaving as documented:
I understand that this is probably not an easy thing to change, but it seems pretty counterintuitive to me that the
paramsdefined on descendants would be applied as props to ancestors.If nothing else, is it worth adding some extra explanation to the docs to clarify how it behaves with nested routes?
Beta Was this translation helpful? Give feedback.
All reactions