main.js 607 B

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