import './assets/main.css'
import './styles/index.scss'
import './styles/icons/iconfont.js'
import VXETable from 'vxe-table'
import 'vxe-table/lib/style.css'
import enUS from 'vxe-table/lib/locale/lang/en-US'
import VxeUI from 'vxe-pc-ui'
import 'element-plus/dist/index.css'
import 'vxe-pc-ui/lib/style.css'
import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/reset.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx'
import ExcelJS from 'exceljs'
import { VLoading } from './directive/VLoading'

import { createApp } from 'vue'
import { createPinia } from 'pinia'

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

const app = createApp(App)

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
// 让VxeTable支持导出Excel
VXETable.use(VXETablePluginExportXLSX, {
  ExcelJS
})
VXETable.setI18n('en-US', enUS)
VXETable.setLanguage('en-US')

app.use(createPinia())
app.use(VXETable)
app.use(VxeUI)
app.use(router)
app.use(Antd)

// 注册全局指令
app.directive('vloading', VLoading)

app.mount('#app')
