main.js 662 B

1234567891011121314151617181920212223
  1. import { createApp } from 'vue'
  2. import App from './App.vue'
  3. import router from './router'
  4. import { setup } from '@/utils/componentHelper'
  5. import http from '@/api/http.js'
  6. import Dialog, { Toast, Alert, DialogContent } from '@/plugin/dialog/index.js'
  7. import '@/plugin/dialog/dialog.scss'
  8. const components = setup(
  9. Dialog, Toast, Alert, DialogContent
  10. )
  11. const CompoentsPlugin = (app) => {
  12. components.forEach(component => component.install(app))
  13. }
  14. const app = createApp(App)
  15. app.config.globalProperties.config = config
  16. app.config.globalProperties.$Dialog = Dialog
  17. app.config.globalProperties.$http = http
  18. app.use(router).use(CompoentsPlugin).mount('#app');