I am developing an application, and I use Vue 2javascript as a framework, inside the loop v-forI need the loop counter to be bound to the name of the v-modelelements, this is my code:
<div v-for="n in total" class="form-group">
<input type="hidden" id="input_id" :name="'input_name_id[' + n + ']'" v-model="form.parent_id_n" />
</div>
I need to nbe a loop counter, for example, for the first element, it should be:
<div class="form-group">
<input type="hidden" id="input_id" :name="'input_name_id[1]" v-model="form.parent_id_1" />
</div>
binding name attributeworks, but I have no idea how to make it work v-model?
source
share