How to change data of a component on a sibling component's event

Hey guys,
I’m a complete beginner learning VueJS.
And I’m making a simple to-do app.

I need to change the data of a sibling component<TodoContainer/> when there’s an event happens in the component<AddTodo/>.

(more specifically, I need to add the entered to-do input to todoList data array when user press enter on the AddTodo component)
But I can’t figure out how to do that.

I know how to pass data to a sibling element using $emit and props, but I don’t know how to make changes to the sibling’s data when an event happens.
If anyone could look at my code and tell me what’s I’m missing, that’d be really appreciated.

I took a brief look at your repository.

There are plenty of Vue.js Todo List tutorials on the web if you search around.

Since you are new to Vue, I suggest starting with one that helps you understand how to architect vue applications in general.

You also might want to look at Vuex, but possibly hold off until you get a better understanding of Vue.

1 Like

Okay :smiley:, thanks!
I’ll look into that :+1: