main.js 689 B

1234567891011121314151617181920212223242526272829303132
  1. import Vue from 'vue'
  2. import App from './App.vue'
  3. import router from './router'
  4. import singleSpaVue from 'single-spa-vue'
  5. import { Loading } from 'element-ui'
  6. import '@/utils/'
  7. Vue.use(Loading.directive)
  8. Vue.config.productionTip = false
  9. const vueOptions = {
  10. el: '#single-spa-app',
  11. router,
  12. render: (h) => h(App)
  13. }
  14. let vueLifecycles = {}
  15. if (process.env.VUE_APP_ALONE) {
  16. delete vueOptions.el
  17. new Vue(vueOptions).$mount('#app')
  18. } else {
  19. vueLifecycles = singleSpaVue({
  20. Vue,
  21. appOptions: vueOptions
  22. })
  23. }
  24. export const bootstrap = vueLifecycles.bootstrap
  25. export const mount = vueLifecycles.mount
  26. export const unmount = vueLifecycles.unmount
  27. export default vueLifecycles