[Vuejs]-How to give ID to every input-form generated using v-for in VueJS?

0👍

I managed to get it to work. v-bind: or ":" shouldn’t be used on v-model. i added as index because n starts from 1 instead of 0.

<div v-for="(n,i) in number"  v-bind:key="n">
        <input ref= "inputs" :id="'str' + n" v-model="inputValues[i]" />
        
</div>

Leave a comment