Answer the question
In order to leave comments, you need to log in
What is the correct way to draw output through the for loop of a form field?
Is it possible to output two different form elements at the same time through the v-for directive - input and textarea? For example, as in the picture:
The list itself in the script looks like this:
{
id: 0,
title: 'Phone',
type: 'text'
},
{
id: 1,
title: 'Message',
type: 'textarea'
},
Answer the question
In order to leave comments, you need to log in
I think you need to do this:
<div v-for="element in emelents">
<div v-if="element.type === 'text'">
<input />
</div>
<div v-if="element.type === 'textarea'">
<textarea><textarea/>
</div>
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question