Vue Component Communication

Last Updated: September 9, 2021

There are several ways to do Vue Component Communication

Child to Parent Communication

Event Bus

Communication between any components

  this.$root.$emit('notified',{
                        type: response.data.type,
                        title:response.data.title,
                        text: response.data.message
                    })

Register the event in component where you want to listen the event.

mounted() {
            this.$root.$on('notified', (response) => {
                this.message = response.data.title
            })
 },

You can see a real work example of our OneInventory Software. We have programmed the Notification component using the Event Bus.