Answer the question
In order to leave comments, you need to log in
How to set the visibility of elements?
Hello. In an answer to a previous question, I was given advice on how to generate a form.
In data, create an array of objects, each of which will have a label, type, value.
And output them with a v-for loop.
v-model cling to value.
And by type you can display different fields. For example v-if="item.type === 'text'", then output text input.
v-if="item.type === 'select'", then select. And in the same object you can store options.
v-if="demo[0].items[0].data === 'radio 1'"
, but the data can change, as well as the index of the desired array cell, which will lead to unexpected results. Текстовые поля
input 1 - тут значение value
Текстовые области
textarea 5 - тут значение value
Чекбокс
checkbox 3 - тут значение value
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