Given a route entry like this:
{
path: '/path/:test_prop',
components: {
default: Bar,
a: Foo
},
props: true
}
Neither component Foo or Bar will receive the test_prop prop
Working example of issue https://jsfiddle.net/6du90epg/231/
I think this is "only" a problem of lacking documentation.
Looking at the source here and here, it's clear that the intended usage with multiple components is this:
{
path: '/multiple/:test_prop',
components: {
default: Bar,
a: Foo
},
props: {
default: true,
a: (route) => ({ test_prop: route.params.test_prop })
}
}
With that, it works as intended: https://jsfiddle.net/Linusborg/6du90epg/237/
And this makes sense, because in most scenarios, each component will/might need a different set of props.
Yup, that works perfectly. Thank you.
Re-opened because we still have to track improvement of docs here. ;)
merged imrpoved docs section, have to republish again tonight, though.
{
path: '/a',
components: {
default: Reader,
toolbar: ReaderToolbar
},
props: {
default : (route) => ({ url: route.query.u, card_ref: route.query.r }),
toolbar : (route) => ({ url: route.query.u, card_ref: route.query.r })
}
}
ReaderToolbar got no props
Most helpful comment
I think this is "only" a problem of lacking documentation.
Looking at the source here and here, it's clear that the intended usage with multiple components is this:
With that, it works as intended: https://jsfiddle.net/Linusborg/6du90epg/237/
And this makes sense, because in most scenarios, each component will/might need a different set of props.