Answer the question
In order to leave comments, you need to log in
How to make a dynamic form in Vue.js using v-for and v-model?
Hello!
I have VUEX, where there is data about which fields in the form should be present, here is an example:
[
{
Type: text,
Name: fio,
Title: ФИО
},
{
Type: tel,
Name: phone,
Title: Телефон
}
]
<div v-for="item in Form.Data" :key="item.Name">
<label>
<input :type="item.Type" v-model="item.Name">
<span>{{item.Title}}</span>
</label>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question