How to communicate between components
Original article There are five ways to send the data from one component to another:
- Using Props (Parent to Child Communication)
- Using Events (Child to Parent Communication)
- Using Event Bus (Communication between any components)
- Using provide/inject (Parent to Child Communication)
- Using this.$refs (Parent to Child Communication)
- Using Event Bus (Communication between any two components)
With Vue 3 this is also not possible any longer to send events. If you like to do so, you have to use a third party project like Mitt. https://github.com/developit/mitt
4 Provide-Inject
https://v3.vuejs.org/guide/component-provide-inject.html#working-with-reactivity