Communication between sibling components in Vue.js 2.0

You can even make it shorter and use the root Vue instance as the global Event Hub:

Component 1:

this.$root.$emit('eventing', data);

Component 2:

mounted() {
    this.$root.$on('eventing', data => {
        console.log(data);
    });
}

Leave a Comment