main.js 968 B

1234567891011121314151617181920212223242526272829303132333435
  1. import Vue from "vue";
  2. import App from "./App.vue";
  3. import router from "./router";
  4. import { store } from "./store/index.js";
  5. import "./assets/style/element-variables.module.scss";
  6. // 引入element ui
  7. import ElementUI from "element-ui";
  8. import "element-ui/lib/theme-chalk/index.css";
  9. Vue.use(ElementUI);
  10. // 引入css
  11. import "./styles/index.scss";
  12. // 注册svg组件
  13. import SvgIcon from "@/components/SvgIcons/index.vue";
  14. Vue.component("SvgIcon", SvgIcon);
  15. // 序列化post方法
  16. import qs from "qs";
  17. Vue.prototype.$qs = qs;
  18. // 引入tailwind
  19. // https://www.tailwindcss.cn/docs/installation
  20. Vue.prototype.$BASE_URL = window?._BASE_CONFIG?.API;
  21. Vue.config.productionTip = false;
  22. if (store.state.auth.userInfo.permission !== undefined) {
  23. store.dispatch("auth/setAddRouter", {
  24. resultRouter:
  25. (store.state.auth.userInfo && store.state.auth.userInfo.permission) || [],
  26. router,
  27. });
  28. }
  29. new Vue({
  30. router,
  31. store,
  32. render: (h) => h(App),
  33. }).$mount("#app");