Wednesday, October 30

Tag: Vue Components

Using Event Bus to Share Props Between Vue Components
CSS Tricks

Using Event Bus to Share Props Between Vue Components

By default, communication between Vue components happen with the use of props. Props are properties that are passed from a parent component to a child component. For example, here’s a component where title is a prop: <blog-post title="My journey with Vue"></blog-post> Props are always passed from the parent component to the child component. As your application increases in complexity, you slowly hit what is called prop drilling that is React-focused, but totally applies). Prop drilling is the idea of passing props down and down and down to child components — and, as you might imagine, it’s generally a tedious process. So, tedious prop drilling can be one potential problem in a complex. The other has to do with the communication between unrelated components. We can tackle a...