How to pass the value of input and the parent?

I have an array and I want when you click add to array was dobavljaci the value of the input , but it almost bring undef

here is the code
//================================================================
the parent component

<template>
 <div id="app" class="container">
 <h1> {{ title }} </h1>
 <TodoInput :items="items" @push="pushForItem" ></TodoInput>
<TodoList></TodoList>
</div>
</template>

the <script>

 TodoInput import from "./components/TodoInput";
 import TodoList from "./components/TodoList";

 export default {
 props: {
 value: String
},

 data() {
 return {
 title: "TodoList",
 items: [],
}
},
 components: {
TodoInput,
TodoList
},
 methods: {
 pushForItem() {
 var input = this.value;

 if ( this.value !== "" ) {
this.items.push({
text:input
})
}
}
}
}

</script>

//========================================================================

//========================================================================
the child component

<template>
the <div>
 <input type="text" v-model="value">
 <button class="btn btn-outline-secondary" @click="addItem">Add</button>
</div>
</template>

the <script>

 export default {
 props: {
 items: {
 type: Array
},
 onValue: {
 type: String
}
},
 data() {
 return {
 value: ""
}
},

 methods: {
 addItem() {
 this.$emit("push", this.value);
}
}
}

</script>
April 3rd 20 at 17:46
1 answer
April 3rd 20 at 17:48
Suggest the author of the post to re-read the meaning of the props and work with events coming from child components.
The answer above solves the problem.

Find more questions by tags Vue.js