Well, there are 2 easy ways, and one more that includes Vuex if your application is large-scale.
The first way to create an Event Bus is to emit events in a single hub, and then catch them where necessary.
const Bus = new Vue({}) Vue.component('lang', { template: '#lang-tmp', data() { return { selected: 'en', langs: [ { text: 'English', value: 'en' }, { text: 'German', value: 'ge' }, ] } }, created() { this.changeLang() }, methods: { changeLang() { Bus.$emit('langChanged', this.selected) } } }) Vue.component('frm', { template: '#frm-tmp', data() { return { selectedItem: 'en' } }, created() { Bus.$on('langChanged', (selected) => { this.selectedItem = selected }) } }) const app = new Vue({ el: '#app' })
http://jsbin.com/siyipuboki/edit?html,js,output
The second way is to create a view of the store - a simple object that will hold the state of the selected item
const store = { data: { selected: null } } Vue.component('lang', { template: '#lang-tmp', data() { return { selected: 'en', langs: [ { text: 'English', value: 'en' }, { text: 'German', value: 'ge' }, ] } }, created() { this.changeLang() }, methods: { changeLang() { store.data.selected = this.selected } } }) Vue.component('frm', { template: '#frm-tmp', data() { return { storeSelected: store.data } } }) const app = new Vue({ el: '#app' })
http://jsbin.com/qagahabile/edit?html,js,output
Also check the VueJS child component data from the parent