main.js

348 阅读1分钟
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import {setPublicPath} from 'systemjs-webpack-interop'
import singleSpaVue from 'single-spa-vue'
import Vue from 'vue'
import router from './router'
import App from './App'

setPublicPath('app2/page1')

// Vue.use(Router)
Vue.config.productionTip = false

// const router = new Router({
//   router: [
//     {
//       path: '/about',
//       name: 'About',
//       // route level code-splitting
//       // this generates a separate chunk (about.[hash].js) for this route
//       // which is lazy-loaded when the route is visited.
//       component: () => import(/* webpackChunkName: "about" */ './components/About.vue')
//     }
//   ]
// })

const vueLifeCycles = singleSpaVue({
  Vue,
  appOptions: {
    render: (h) => h(App),
    router
  }
})

export const bootstrap = vueLifeCycles.bootstrap
export const mount = vueLifeCycles.mount
export const unmount = vueLifeCycles.unmount

/* eslint-disable no-new */
// new Vue({
//   el: '#app',
//   router,
//   components: { App },
//   template: '<App/>'
// })