The user is requested to add columns giving a name and other information associated to the new column. My current issue is that i could see the new columns added into an array but they are undefined. Not sure if i am missing something or the way i am binding is not correct..
VIEW:
div(v-for='column in columns')
.row
label Name
Input(type='text, v-model='model.name')
.row
label Age
Input(type='text' v-model= 'model.age')
....
button(@click='save()') Save
button(@click='addColumn()') Add Column // this will add another set of inputs
VUE Code:
model: ColumnModel = new ColumnModel();
column: ColumnModel;
columns: ColumnsModel[]=[]
beforeMount(){this.columns.push(this.column);}
addColumn() { this.columns.push(...this.columns)}
save() { api post passing in this.columns}
with what i currently have - everytime i add a new column i see it added to the array but the item added is undefined so my columns array would be size 2 and [0:undefined, 1:undefined]