1
I have the following object array below. I need to list in a v-for
only records where the variable parent
be equal to 4
, and I’m not getting it.
Code:
this.full_category_list = [
{
id: 1,
name: 'Sólido',
parent : 0,
},
{
id: 2,
name: 'Líquido',
parent : 0
},
{
id: 3,
name: 'Madeira',
parent : 1
},
{
id: 4,
name: 'Ferro',
parent : 1
},
{
id: 5,
name: 'Chapas',
parent : 4
},
{
id: 6,
name: 'Tubos',
parent : 4
},
{
id: 7,
name: 'Vigas',
parent : 4
},
];
Create a computed property that matches this list. And in v-for use this property.
– bfavaretto