The data is not added to the table because basically, you are adding empty properties in addNewItem method.
addNewItem() {
this.items.push({
id: '',
age: '',
first_name: '',
last_name: ''
});
}
The items list variable is where you are going to insert all your items. For the form data, you should create another variable to catch them and then push the single object to the list:
export default{
data(){
return{
// single object where you are going to catch form data
item:{
id: null,
age: null,
first_name: '',
last_name: ''
}
// Your list of objects
items: [
{ id: 1, age: 40, first_name: 'Dickerson', last_name: 'Macdonald'},
{ id: 2, age: 21, first_name: 'Larsen', last_name: 'Shaw' },
{ id: 3, age: 89, first_name: 'Geneva', last_name: 'Wilson' },
{ id: 4, age: 38, first_name: 'Jami', last_name: 'Carney' }
],
}
}
}
so, in the input models instead of items.property_name use item.property_name
<b-form inline>
<b-form-input
v-model="item.id"
requierd
placeholder="Id"
></b-form-input>
<b-form-input
v-model="item.age"
requierd
placeholder="Age"
></b-form-input>
<b-form-input
v-model="item.first_name"
requierd
placeholder="First Name"
></b-form-input>
<b-form-input
v-model="item.last_name"
requierd
placeholder="Last Name"
></b-form-input>
</b-form>
then in the addNewItem() Method push the single object to the list
addNewItem() {
this.items.push(this.item);
}