import { createApp } from 'vue';
import { createPinia } from 'pinia';
import App from './App.vue';
import router from './router';
// 样式
import '@/assets/main.css';
// 动画
import 'animate.css';
// element
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import locale from 'element-plus/lib/locale/lang/zh-cn';
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
// 图标
import '@common/src/assets/icon/iconfont.css';
// moment
import moment from 'moment';
// lodash
// import _ from 'lodash';

// 组件
import frameComponents from '@/components/index';
const app = createApp(App);
app.use(createPinia());
app.use(router);
app.use(ElementPlus, { locale });
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
app.config.globalProperties.$moment = moment;

for (const componentItme in frameComponents) {
  app.component(componentItme, frameComponents[componentItme]);
}
app.config.globalProperties.$limit = parseInt(import.meta.env.VITE_APP_PAGE_SIZE) || 10;

app.mount('#app');
