import { createApp } from 'vue'; //vu3
import pinia from '/@/stores'; //状态管理器
import App from '/@/App.vue';
import router from '/@/router'; //路由
import { directive } from '/@/directive'; //指令
import { i18n } from '/@/i18n'; //国际化
import other from '/@/utils/other';  //工具类
import mitt from 'mitt'

import ElementPlus from 'element-plus';
import '/@/theme/index.scss';
import VueGridLayout from 'vue-grid-layout';

/*ElementPlus.Table.props.headerCellStyle = {
    type:[Object,Function],
    default:()=>{
        return {
            backgroundColor:'red'
        }
    }
}*/

const app = createApp(App);


// @ts-ignore 全局消息总线
app.config.globalProperties.$bus = new mitt();
//权限校验
app.config.globalProperties.$auth =(auth:any,all:boolean=false)=>{
    if(!auth){
        return true;
    }
    console.log("$auth:",auth)
    return true;
}

directive(app);

//注册全局图标组件
other.elSvg(app);

app.use(pinia).use(router).use(i18n).use(ElementPlus).use(VueGridLayout).mount('#app');
