<modal :width="1000" :height="100" name="list-programs">
<select name="" id="program" class="form-control" @change="onAddProgram()">
<option>...</option>
<option v-for="item, index in programlist" v-if="item" :value="index">{{ item.print_code + ' - ' + item.title }}</option>
</select>
</modal>
<table class="table dataTable">
<tr>
<th>Программа</th>
<th>Сумма по программе</th>
</tr>
<tr v-for="(item, index) in data" @click="onSelectedProgram(index)" :class="{'active-tr': selectedProgramIndex === index}" style="border: 1px solid black">
<td>{{ programlist[index].print_code + " - " + programlist[index].title }}</td>
<td>{{ programlist[index].summa }}</td>
</tr>
</table>
onAddProgram() {
let index = $("#program option:selected").val();
this.data[index] = []
this.hide('list-programs')
console.log(this.data)
},
При добавлении не работает перебор внутри таблицы.
Для дальнейшего кода мне надо чтобы индексы элементов programlist
был индексов массива data