DEV Community

Discussion on: Using event bus in Vue.js to pass data between components

Collapse
 
broderick profile image
Broderick Stadden

Keep in mind this is not a replacement for parent-child events. You should preserve that data flow for most components because logic should be self contained when possible.

It’s very easy to make your app a mess if you are throwing everything into the event bus. This should only really be used if you need to pass data from one container component (a parent component responsible for its children) to another container component. There might be some other small use cases but just be careful. Also, if it’s state, consider using Vuex instead.