I created a form using Vue and Vuetify using json data and looped that json to create form. How to the show input type text field when we select option in the first select element
<form>
<div v-for="(field, index) in fields" :key="index">
<v-select v-if="field.type=="select"
:items="field.values"
:label="field.label"
v-model="field.model"
></v-select>
<!-- to show the below text field when we select -->
<!--option from select -->
<v-text-field v-else
:label="field.label"
v-model="field.model"
></v-text-field>
</div>
</form>
Here is the array:
data(){
return{
fields:[
{
type: "select"
label: 'One',
values: ["Virtual Partner", "some"],
model: '',
},
{
type: "text"
label: 'Text',
model: '',
},
{
type: "select"
label: 'Two',
values: ["some 2", "some"],
model: '',
},
{
type: "select"
label: 'Three',
values: ["some 3", "some"],
model: '',
},
]
}
}
Please help. Thank you.