main.ts 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { createApp } from 'vue'; //vu3
  2. import pinia from '/@/stores'; //状态管理器
  3. import App from '/@/App.vue';
  4. import router from '/@/router'; //路由
  5. import { directive } from '/@/directive'; //指令
  6. import { i18n } from '/@/i18n'; //国际化
  7. import other from '/@/utils/other'; //工具类
  8. import mitt from 'mitt'
  9. import ElementPlus from 'element-plus';
  10. import '/@/theme/index.scss';
  11. import VueGridLayout from 'vue-grid-layout';
  12. /*ElementPlus.Table.props.headerCellStyle = {
  13. type:[Object,Function],
  14. default:()=>{
  15. return {
  16. backgroundColor:'red'
  17. }
  18. }
  19. }*/
  20. const app = createApp(App);
  21. // @ts-ignore 全局消息总线
  22. app.config.globalProperties.$bus = new mitt();
  23. //权限校验
  24. app.config.globalProperties.$auth =(auth:any,all:boolean=false)=>{
  25. if(!auth){
  26. return true;
  27. }
  28. console.log("$auth:",auth)
  29. return true;
  30. }
  31. directive(app);
  32. //注册全局图标组件
  33. other.elSvg(app);
  34. app.use(pinia).use(router).use(i18n).use(ElementPlus).use(VueGridLayout).mount('#app');