0👍
Change your code:
addTodo (toDo) {
this.todos.push(toDo)
}
Because the data you pass from the child component itself is an Object, so you don’t need to use the {}
symbol anymore.
- [Vuejs]-How to send virtual pageview using vue-analytics?
- [Vuejs]-Is there an easy way to make SPA auth in Vue.js + Laravel without using JWT?
0👍
If I am seeing everything correctly, the problem is that the emit is firing on the child node and not being caught in the parent. Try this
this.$parent.$emit('add-todo', {
title: title,
project: project,
done: false
})
In this yours was this.$emit
, I am proposing this.$parent.$emit
Source:stackexchange.com