Skip to content

Instantly share code, notes, and snippets.

@lancegliser
Created January 3, 2020 22:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lancegliser/91d16fd8e10db240610f7acfb8d9d9c3 to your computer and use it in GitHub Desktop.
Save lancegliser/91d16fd8e10db240610f7acfb8d9d9c3 to your computer and use it in GitHub Desktop.
Provides a method for emitting root events onto the correct root instance of an application.
import vm from "@/main";
const emitOnMain = (event) => {
vm.$root.$emit(event);
};
import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';
const vm = new Vue({
router,
store,
render: (h) => h(App),
}).$mount('#app');
export default vm;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment