SOURCE

console 命令行工具 X clear

                    
>
console
var bus = new Vue();

Vue.component('component-a', {
  template: '<button @click="handleEvent">传递事件</button>',
  methods: {
    handleEvent: function() {
      bus.$emit('on-message', '来自组件component-a的内容');
    }
  }
});

var app = new Vue({
  el: '#app',
  data: {
    message: ''
  },
  mounted: function() {
    var _this = this;
    bus.$on('on-message', function(msg) {
      _this.message = msg;
    })
  }
})
<div id="app">
  {{ message }}
  <component-a></component-a>
</div>
<script src="https://cdn.bootcss.com/vue/2.4.4/vue.js"></script>