I'm new in in vue, I have this json:
and I have this object in store:
company_profiles: [
{
profile: {
projects: {
team: {
teammate: {
contracts: {}
}
}
}
},
}
],
I tried to do loop for:
<div
v-for="contract in company_profiles.profile.projects.team.teammate.contracts">
{{ contract }}
</div>
but in console I have this error:
TypeError: Cannot read properties of undefined (reading 'teammate')
company_profiles.profile.projects is an array, so reading .team on it is undefined.
maybe try
<div
v-for="project in company_profiles.profile.projects"
:key="project.id"
>
<h3>{{ project.name }}</h3>
<h4>contract:</h4>
<pre v-html="project.team?.teammate?.contract" />
</div>