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

// 去除警告： Added non-passive event listener to a scroll-blocking ‘wheel‘
import 'default-passive-events'

// createApp
const app = createApp(App);

// 安装 pinia
import store from "./store";
app.use(store);

// 安装 vue-router
import './router/router-guards'
import router from './router';
app.use(router);

// 安装 Element-Plus
import 'element-plus/dist/index.css';
import ElementPlus from 'element-plus';
import zhCn from 'element-plus/es/locale/lang/zh-cn'
app.use(ElementPlus, {
    locale: zhCn,
    // size: 'small'
});

// 全局图标 
import { initElIcons } from "./init/init-el-icons";
initElIcons(app);

// 全局表单组件 
import { initSaForm } from "./init/init-sa-form";
initSaForm(app);

// 全局样式
import './layout/theme.css';
import './layout/transition.scss'
import './sa-frame/kj/layer/theme/default/layer.css'
import './sa-frame/sa.scss';

// 全局 sa 对象
import sa from './sa-frame/sa.js';
import './sa-frame/kj/upload-util.js';
app.config.globalProperties.sa = sa;
globalThis.sa = sa;

// 全局异常处理 
import {initErrorHandler} from "./init/error-handler";
initErrorHandler(app);

// 绑定dom
app.mount('#app');
