Chapter 6
Components Continued & Firebase Storage: Creative Cards App
Section 19
Introduction to the event bus
When looking at components in this last few sections, we have looked at how parent-child components can communicate. We know we pass data from the child to the parent with custom events. Also, we know we pass data back from the parent to the child using props. This works well if the components which are to communicate are only 1 level apart like so far in the app. For example, the text input and output components are direct children of card front. This makes communication easy to achieve. However, there are often circumstances where components are nested 2 or more levels apart and need to communicate. This is common as our app grows. For this vue js provides a solution called the event bus.