I'm passing the data as
route
{
path: '/name/:nameSlug',
name: 'NameItem',
props: true,
components: { home: Name }
},
router link to component
<router-link :to="{ name: 'NameItem', params: { nameSlug: name.nameSlug } }">
{{ name.english }}
</router-link>
// name object
{
"id": 1303,
"english": "bob",
"gender": "M",
"nameSlug": "bob"
}
NameItem props
props: {
nameSlug: {
type: String,
required: true
}
},
I'm getting the following error for this page, what is the issue? using "vue-router": "^3.2.0":
TypeError: Cannot read property 'nameSlug' of undefined
or this, note the url does change correctly
[Vue warn]: Missing required prop: "nameSlug"
name.nameSlug
than anything to do with the router or props. What doesname
object look like? – Beyers