First, this looks off because of the loop that you are not using. (Is there a mistake or why bother showing it?)
A v-if should work, but it often gets verbose.
<div class="propiedad" v-if="project.Property && project.Property.length > 0 && project.Property[0].Number>
That should cover all the bases.
Therefore it's often cleaner to massage the data beforehand. Maybe make all projects have defaults.project.Property, so you don't have to check if it exists.
Or just make computed properties so your template can look nice
computed: {
hasProperty(){
return this.project.Property
&& this.project.Property.length > 0
&& this.project.Property[0].Number
}
}
<div class="propiedad" v-if="hasProperty"> ... </div>
Or if this is indeed related to the loop . Make a computed array that filters the array.
computed: {
// Here I make the wild assumption that info are actually projects
// (just to make the loop relevant)
filtered(){
// Skip all the projects without "Properties".
return this.info.filter( i => i.Property.length > 0 )
}
}
<div v-for="propiedad in filtered"> ....
v-ifdid you try? Where doesprojectcome from and what sort of data is in it? What does it have to do withinfoorpropiedad?