[Vuejs]-How to bind index to value attribute in vuejs

2👍

V-model is essentially syntax sugar for updating data on user input events, plus special care for some edge cases.

So

<input type="hidden" v-model="question.question_no">

is same as

<input type="hidden" :value="index" @input="question.question_no=$event.target.question.question_no">

So you can’t use both the syntax together.
Either use first one or second one according to your use case.

Edit

As input type is hidden

<input type="hidden" :value="index">
should be enough.

Reference

Leave a comment