import { createApp } from 'vue'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as Icons from '@element-plus/icons-vue'
import mitt from 'mitt';

import Header from './components/Header.vue';
import backIndex from './components/backIndex.vue';

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

const app = createApp(App)
const emitter = mitt()

Object.keys(Icons).forEach((key) => {
    app.component(key, Icons[key]);
});

app.use(ElementPlus)
app.use(router)
app.config.globalProperties.emitter = emitter;

app.component('Header', Header);
app.component('backIndex', backIndex);

app.mount('#app')