title: How to create a hook with events between VUE 2.0 components
body: <p>I've created two <a href="https://vuejs.org/guide/components.html#Dynamic-Components" rel="nofollow noreferrer">dynamic</a> components. Now, using <a href="https://vuejs.org/api/#Instance-Methods-Events" rel="nofollow noreferrer">events: $emit/$on</a>
  <strong>what I need is to fire the "logThat(someObj)" method  of the component-two passing the arguments</strong> as you can see in this fiddle:</p>
  
  <pre><code>Vue.component('component-one', {
      template: '#template-a',
      methods: {
          onClick() {
              const someObj = {
                  foo: "foo",
                  bar: "bar"
              }
  
              vm.$emit('selected', someObj)
              vm.currentView ='component-two';
          }
      }
  });
  
  //Any hint??
  /*vm.$on('selected', (someObj) =&gt; {
      this.logThat(someObj)
  })*/
  
  Vue.component('component-two', {
      template: '#template-b',
      methods: {
          onClick() {
              vm.currentView ='component-one';
          },
          logThat(someObj) {
              console.log(someObj);
         }
      }
  });
  </code></pre>
  
  <p><a href="https://jsfiddle.net/wanxe/yuh71e1o/" rel="nofollow noreferrer">https://jsfiddle.net/wanxe/yuh71e1o/</a></p>
  
  <p>If anyone has any suggestions of how to handle this, it will be appreciated :)</p>