DEV Community

Discussion on: Dynamically Add/Remove input fields using Vuejs

Collapse
 
nasrinafrozkakoli profile image
Nasrin Afroz Kakoli

It was so well instructed that I could learn in depth and knew what is happening there. Added a little modification to use the properties of actual object that was pushed with a dummy property before ; ex- {value : "" , }

addField(object, fieldType) {
    let newObject ={};
    for (const [key, value] of Object.entries(object)) {
        newObject[key]="";
    }
    fieldType.push(newObject);
},
Enter fullscreen mode Exit fullscreen mode