import { createApp } from 'vue';
import '@/assets/styles/index.scss';
import App from './App.vue';
import router from './router';
import store from './store';
import api from './api';
import utils from './utils';
import plugins from './plugins/index';
import animate from './utils/animate';
import VueLazyload from 'vue-lazyload';
import './router/permission';

// 自定义指令
import directive from './directive';

// svg图标
import 'virtual:svg-icons-register';
import ElementIcons from '@/plugins/svgicon';

import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

const app = createApp(App);
// 预设动画
app.config.globalProperties.animate = animate;
// 请求方法
app.config.globalProperties.$http = api;
// 请求方法
app.config.globalProperties.$utils = utils;
//图标
app.use(ElementIcons);
//路由
app.use(router);
//插件
app.use(plugins);
//缓存数据
app.use(store);
//图片懒加载
app.use(VueLazyload, {
    preLoad: 1.3,
    attempt: 1,
});
//ElementUi默认中文
app.use(ElementPlus, {
    locale: zhCn,
  })
// 自定义指令
directive(app);
app.mount('#app');
