A
A
Anton2019-04-26 14:48:50
Vue.js
Anton, 2019-04-26 14:48:50

How to write cycle index to attribute?

The first day I pick, I can not understand.
The construction through name="{{index}}" doesn't work, I don't understand why.
Therefore, using :name='index' works, but I can't even figure out how to concatenate it with a string to get
name="group[0][1]" at the output, where the second element of the array is exactly this index described above counter?
In this example, I use value in the input to immediately see what is happening there

<th v-for='(item, index) in complects'><button @click='deleteItemComplect(item)' @keyup.enter='deleteItemComplect(item)'>X</button><input type="text" :value='index' :placeholder='item.placeholder'></input></th>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question