import { createApp } from 'vue'
import 'vue-global-api'
import App from './App.vue'
import router, { setupRouter } from 'Plugins/router'
import { setupStore } from 'Store/index'
import { message } from 'ant-design-vue'
// 样式引入
import 'ant-design-vue/dist/reset.css'
import '@/assets/styles/common.less'
import 'uno.css'

const app = createApp(App)
async function setupApp() {
  // 挂载pinia状态管理
  setupStore(app)

  // 挂载路由
  await setupRouter(app)

  router.afterEach((to) => {
    // 发送页面浏览事件到 Google Analytics
    window.dataLayer?.push({
      event: 'page_view',
      page_path: to.path,
      page_title: document.title
    });
  });

  app.mount('#app')
}

setupApp()

