[Vuejs]-Vue.js and Form array

0👍

Ah I found it – need to use v-bind to dynamically set the name.

<div class="col-md-2">
    @Html.SmartLabel("quantity", "Quantity", true, labelClass)
    <input type="number" min="1" class="form-control" v-model="order[key].quantity" v-bind:name="'Quantities[' + key + '].Quantity' " />
</div>

https://medium.com/swlh/building-dynamic-forms-with-django-formsets-and-vue-js-f3c6e2dddd4a

Leave a comment