Mikel Granero
Mikel Granero

Reputation: 419

Fill input value inside a v-for

I'm trying to set the value for each input inside a v-for, but the value is not shown in the input. {{slideshow.timeout}} is printing the value, but the v-model is not working. Am I missing something? I'm new to Vue.

<tr v-for="(slideshow, index) in slideshows">             
      <td>{{slideshow.timeout}}</td>
      <td>
         <input type="text" :model="slideshow.timeout" class="form-control">
      </td>

</tr>

Upvotes: 1

Views: 32

Answers (1)

Boussadjra Brahim
Boussadjra Brahim

Reputation: 1

Try this out:

  <input type="text" v-model="slideshows[index].timeout" class="form-control">

since v-model is a directive et it's not a bound attribute

Upvotes: 1

Related Questions