Created
January 3, 2020 22:54
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import vm from "@/main"; | |
const emitOnMain = (event) => { | |
vm.$root.$emit(event); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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