0
I have the following screen:
Who are basically disciplines with their classes.
I’m using Vuejs, where I have an object with JSON with a list Disciplines containing a list of id classes.
The screen is mounted using the code:
<tr v-for="(valor,index) in periodos.Disciplinas">
<td >
<input type="checkbox" v-bind:value="valor.Codigo"
v-model="DisciplinaSelecionado" v-on:change="atualizaSimulacao">
</td>
<td >
<h5 class="font-weight-bold">{{valor.Nome}}</h5>
{{valor.Codigo}}
<br />
IdTurmaSelecionado {{IdTurmaSelecionado}}
<br />
<div class="row">
<div class="col-sm-4" v-for="(turma,index) in valor.Turmas">
<input type="radio"
v-bind:name="valor.Codigo"
v-bind:value="valor.Codigo + '*' + turma.IDTURMADISC" />
<label class="font-weight-bold">Turma: {{turma.IDTURMADISC}}</label>
</div>
</div>
</td>
</tr>
Usually just add a v-model using a variable created in Vue that recovers the selected value on the radio button. However as there are several separate lines I’m not getting the expected result, because when I add a v-model
<input type="radio" v-bind:name="valor.Codigo" v-bind:value="valor.Codigo + '*' + turma.IDTURMADISC" v-model="IdTurmaSelecionado/>
I need an array of all selected Class Id s in each discipline in the Vuejs scope (model).