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
-
Related: #1191.
I encountered this problem on Vue Land. Example:
The key things to note are:
props: true
because it wantsusername
to be passed as a prop.props
because it wants to convertid
to a number.The reason this happens is because the
id
prop is being passed to the parent. It ends up inattrs
. These are then being inherited by the root-level<RouterView />
in the parent, passingid
down 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
params
defined 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