I have a form with three input fields name, email and phone but I want the user to be able to add more input fields dynamically so for every new input field added to the form, I want to declare a variable in the form object of data function.
The data() function is as below:
data(){
return{
form:{
name:'',
email:'',
phone: '',
}
}
}
Here as you can see I have three variables in the form object but I want to dynamically add another variable like phone2, phone3...etc. whenever a new input field is added dynamically to the form.
Any help is appreciated in advance.