import { createApp } from 'vue'
import { setupStore } from '@/store'

import App from './App.vue'
import router from './router'

// element
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import locale from 'element-plus/es/locale/lang/zh-cn'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// 请求检查函数
import { InitCheckResult } from './utils/checkResult'
import { InitVariable } from './utils/variable'
// 组件
import globalComponents from '@/components'
// 自动滚动
import vue3SeamlessScroll from 'vue3-seamless-scroll'
// Antd
import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/reset.css'
import 'default-passive-events'

const app = createApp(App)
globalComponents(app)
setupStore(app)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(router)
app.use(Antd)
app.use(ElementPlus, { locale })
app.use(vue3SeamlessScroll, { name: 'vue3SeamlessScroll' })
InitCheckResult(app)
InitVariable(app)
app.mount('#app')
