In this area, I want to enter people's name and surname. This is my small component.
<v-row v-for="(list,i) in getList" :key="'list-item-'+i">
<v-col cols="6"><v-text-field v-model="name"/></v-col>
<v-col cols="6" > <v-text-field v-model="surName"/></v-col>
</v-row>
data(){
return{
name:nulll,
surName:null
}
},
computed: {
getList() {
const newCategory = []
const getCategory= [
{category: 'elder', count: 3},
{category: 'babies', count: 1},
{category: 'children', count: 0}
]
getCategory.map(item => {
return item.count > 0 ? newCategory .push(item) : null
})
return newCategory
}
},
The getList is an array and I filtered it if the count is not bigger than 0. My problem is about creating the right component counts for every
object. For example, there are 3 elders and 1 baby in my getList
array. So ı need to create 4 component forms for this.
But in my solution I can obtain only 2 components. 1 elder and 1 baby. Sure I need to create 4 components. 3 elders and 1 baby.