import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

// ElementPlus
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import 'element-plus/dist/index.css'
import '@/style/element-variables.scss'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
//iconpark
import {install} from '@icon-park/vue-next/es/all';


const app = createApp(App);

app.use(store);
app.use(router);
app.use(ElementPlus, {
  locale: zhCn,
})

// element-plus icon, 以ElIcon开头，例如ElIconEdit
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component('ElIcon' + key, component)
}
// iconpark, 以IconPark开头, 例如IconPark-people
install(app, 'IconPark')

//echarts
import * as echarts from 'echarts'
app.config.globalProperties.$echarts = echarts;

// 全局方法
import util from '@/utils/index'
app.config.globalProperties.$util = util
// 常量
import constant from '@/utils/constant'
app.config.globalProperties.$constant = constant

app.mount('#app');

export default app


