I pass a list of values from a parent component to its child and want to receive all of the values but I only receive the last one.
This is the code for the parent component:
<app-spider-web
v-for="skill in skills"
:name="skill.name"
:required="skill.required"
:vMode1="skill.vMode1"
></app-spider-web>
...
skills: [
{
name: 'Frozen Yogurt',
required: 1,
vMode1: ''
},
{
name: 'Ice cream sandwich',
required: 3,
vMode1: ''
},
{
name: 'Eclair',
required: 1,
vMode1: ''
}
]
And this is the code for the child component:
props:['name','required','vMode1']
This way I receive the data one by one and if I want print for instance 'name' it only shows the last name in the list which is 'Eclair' whereas I want to have an array in child components with all the names in them. What's the best way to do it?