You have a couple of things suspicious in this code. First of all, it's your JSON structure. Your
skills
field is an array that consists of a single object. I assume you'd want to have just an object instead.
{
"skills": {
"name": "skills",
"frontend": [
{
"id": "1",
"name": "Vue",
"icon": "Vue"
},
{
"id": "2",
"name": "HTML",
"icon": "HTML"
},
{
"id": "3",
"name": "Javascript",
"icon": "Javascript"
},
{
"id": "4",
"name": "Tailwind",
"icon": "Tailwind"
},
{
"id": "5",
"name": "Bootstrap",
"icon": "Bootstrap"
}
],
"backend": [
{
"id": "1",
"name": "Laravel",
"icon": "Laravel"
},
{
"id": "2",
"name": "PHP",
"icon": "PHP"
}
]
}
}
Secondly, you try to access
frontend.name
as if it was and object but instead it's an array of frontend skills. So what you need is to iterate both arrays of skills separately. Your main component will look as
<template>
<div>
<h3>
Frontend
</h3>
<Skills v-for="skill in skills.skills.frontend" :skill="skill" :key="skill.id"/>
</div>
<div>
<h3>
Backend
</h3>
<Skills v-for="skill in skills.skills.backend" :skill="skill" :key="skill.id"/>
</div>
</template>
While your skill template will look like
<template>
<div>
<div>
<p>{{ skill.name }} </p>
</div>
</div>
</template>