D
D
Dmitry Baskakov2020-01-20 06:22:57
Vue.js
Dmitry Baskakov, 2020-01-20 06:22:57

How to combine v-bind on multiple attributes?

How to combine multiple attributes in one v-bind statement?
Now I have this code. Everything works, but too much code:

<input type="checkbox" :name="[index === 0 ? 'firstChildFieldPhone' :
'secondChildFieldPhone']" :id="[index === 0 ? 'firstChildFieldPhone' :
'secondChildFieldPhone']" checked>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aetae, 2020-01-20
@dmitrybascacov

Make a computed property return the desired values.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question