My problem is as follows, I have two separate checkboxes, where the list of the first box is loaded through a json
.
And I need to load the second checkbox depending on the value selected in the first box, with the contents of the two boxes coming from the same json
.
The first box is mounted as follows:
<div class="wrapper-radio" v-for="item in modalidades">
<input type="radio" name="slcModalidad" v-bind:id="'slcModalidad' + item.id">
<label v-bind:for="'slcModalidad'+item.id" class="slc-text">
{{item.nome}}
</label>
</div>
So far so good, but in the second box besides not being able to create the condition, I can not call the items inside another v-for .
><div class="wrapper-radio" v-for="item in modalidades">
<input type="radio" name="slcRubro" id="slcRubro1">
<label for="slcRubro1" class="slc-text">
{{item.rubro.rubroNome}}
</label>
</div>
This is json being used:
{
"modalidades": [{
"id": 0,
"nome": "Venta presencial y/o mostrador",
"rubros": [{
"id": 0,
"rubroNome": "Accesorios, servicios y repuestos de automotor"
},
{
"id": 1,
"rubroNome": "Agencia de turismo"
}
]
},
{
"id": 1,
"nome": "Venta Telefónica",
"rubros": [{
"id": 0,
"rubroNome": "teste1"
},
{
"id": 1,
"rubroNome": "teste2"
}
]
},
{
"id": 2,
"nome": "E-Commerce",
"rubros": [{
"id": 0,
"rubroNome": "teste1"
},
{
"id": 1,
"rubroNome": "teste2"
}
]
},
{
"id": 3,
"nome": "Débito Automático",
"rubros": [{
"id": 0,
"rubroNome": "teste1"
},
{
"id": 1,
"rubroNome": "teste2"
}
]
},
{
"id": 4,
"nome": "Suscripciones",
"rubros": [{
"id": 0,
"rubroNome": "teste1"
},
{
"id": 1,
"rubroNome": "teste2"
}
]
}
]
}
Should I make a v-if
before the second v-for
?