Share data between components

emilo Post Leave a Comment

export const bus = new Vue(); = All your events get stored in here

import Vue from 'vue'
import App from './App.vue'

export const bus = new Vue(); //Alle events blir lagret her

new Vue({
  el: '#app',
  render: h => h(App)
})
<template>
  <div class="container">
    <app-list></app-list>
    <app-selected></app-selected>
    </div>
</template>
<script>
import List from "./assets/components/List.vue";
import Selected from "./assets/components/Selected.vue";
export default {
  data: function() {
    return {};
  },
  components: {
    'app-list': List,
    'app-selected': Selected
  }
};
</script>
<style>
</style>