title: Vue.js 3 Event Bus
body: <p>How to create Event Bus in Vue 3?</p>
  <hr />
  <p>In Vue 2, it was:</p>
  <pre class="lang-js prettyprint-override"><code>export const bus = new Vue();
  </code></pre>
  <pre class="lang-js prettyprint-override"><code>bus.$on(...)
  bus.$emit(...)
  </code></pre>
  <hr />
  <p>In Vue 3, <code>Vue</code> is not a constructor anymore, and <code>Vue.createApp({});</code> returns an object that has no <code>$on</code> and <code>$emit</code> methods.</p>