main.ts 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. 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');