title: Working with dynamic components in vue.js
body: <p>I have a simple application which need to render 2 components dynamically.</p>
  
  <ul>
  <li><strong>Component A</strong> - needs to have onClick event.</li>
  <li><strong>Component B</strong> - needs to have onChange event.</li>
  </ul>
  
  <p>How is it possible to dynamically attach different events to component A/B?</p>
  
  <pre><code>&lt;template&gt;
    &lt;component v-bind:is="currentView"&gt;
    &lt;/component&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  import A from '../components/a.vue'
  import B from '../components/b.vue'
  
  export default {
    data: function () {
      return {
        currentView: A
      }
    },
    components: { A, B }
  }
  &lt;/script&gt;
  </code></pre>