window.Event = new Vue(); Vue.component('nav-bar', { template: ` `, data() { return { isActive: false } }, methods: { toggleState() { this.isActive = !this.isActive; } } }); Vue.component('nav-migas', { data() { return { migas: [] } }, computed: { visible: function() { return this.migas.length > 0 } }, mounted() { Event.$on('migas-setear-como-inicio', (miga) => { this.migas = []; this.migas.push(miga); }); Event.$on('migas-agregar', (miga) => { this.migas.push(miga); }); Event.$on('migas-reset', () => { this.migas = []; }); Event.$on('migas-pop', () => { this.migas.pop(); }); } }); new Vue({ el: '#app' });