How to combine v-bind multiple attributes?

How to combine several attributes in a single expression v-bind?

Now I have such code. It works, but too much code:
<input type="checkbox" name="[index === 0 ? 'firstChildFieldPhone' :
'secondChildFieldPhone']" id="[index === 0 ? 'firstChildFieldPhone' :
'secondChildFieldPhone']" checked>
April 4th 20 at 12:57
2 answers
April 4th 20 at 12:59
Solution
To make a computed property that returns the desired value.
But if the property value depends on the loop counter? - Sister.Kuphal57 commented on April 4th 20 at 13:02
@jaquelinmeans to make a computed property for that array, which then goes the cycle. - elijah.Bartoletti commented on April 4th 20 at 13:05
@maude79, Sounds interesting. Try this

(it is interesting that even somehow did not think about it) - Sister.Kuphal57 commented on April 4th 20 at 13:08
April 4th 20 at 13:01
Solution
<input v-bind="{
 attr1: val1,
 attr2: val2,
 attr3: val3,
 attr4: val4,
}">

Find more questions by tags Vue.js