Looking for a solution where I can have the ability to dynamically add input fields to a form. Currently, my form consists of three input fields - name, email, and phone. However, I would like users to be able to add more input fields as needed. In order to achieve this, I need to declare a variable in the data function of the form object each time a new input field is added.
Below is the data() function:
data(){
return{
form:{
name:'',
email:'',
phone: '',
}
}
}
As you can see, there are only three variables in the form object currently. I am looking for a way to dynamically add additional variables like phone2, phone3, and so on whenever a new input field is added to the form.
Your help will be greatly appreciated. Thank you in advance!