main.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. import { useUserInfo } from '/@/stores/userInfo';
  22. // @ts-ignore 全局消息总线
  23. app.config.globalProperties.$bus = new mitt();
  24. //权限校验
  25. app.config.globalProperties.$auth =(auth:any,all:boolean=false)=>{
  26. if(!auth){
  27. return true;
  28. }
  29. // console.log("$auth:",auth)
  30. return true;
  31. }
  32. directive(app);
  33. //注册全局图标组件
  34. other.elSvg(app);
  35. app.use(pinia).use(router).use(i18n).use(ElementPlus).use(VueGridLayout).mount('#app');