main.ts 472 B

123456789101112131415161718
  1. import App from "./App.vue";
  2. import { createSSRApp } from "vue";
  3. import 'virtual:svg-icons-register'
  4. import { createPinia } from "pinia";
  5. import { http } from "./utils/http";
  6. import zzxIcon from '@/components/zzx-icon/zzx-icon.vue'
  7. export function createApp() {
  8. const app = createSSRApp(App);
  9. const pinia = createPinia();
  10. app.component('zzxIcon', zzxIcon);
  11. app.use(pinia)
  12. // 挂载全局属性
  13. app.config.globalProperties.$http = http;
  14. return {
  15. app,
  16. pinia
  17. };
  18. }