2

I am using Vue2 to loop through a data set and need to access the index within the input elements attribute as shown below. The problem is I am not binding to vue data entirely but just need the index. And using the colon syntax to bind will look for email within the vue data, which I don't want/need.

Currently, I am getting the following error:

Interpolation inside attributes has been removed.

Any idea how to accomplish this?

<div>
   <div class="row">
       <div class="col-md-12" v-for="(item, index) in contact.emails">
          <input :value="item.email" name="emails[{{ index }}][email]" />
AnchovyLegend
  • 12,139
  • 38
  • 147
  • 231

0 Answers0