main.js 786 B

1234567891011121314151617181920212223242526272829303132
  1. import Vue from 'vue'
  2. import App from './App'
  3. import store from './store' // store
  4. import plugins from './plugins' // plugins
  5. import './permission' // permission
  6. import { getDicts } from "@/api/system/dict/data"
  7. Vue.use(plugins)
  8. /**
  9. * 引用全局加载 loading
  10. * */
  11. import loading from "./components/loading/loading.vue"
  12. Vue.component('loading',loading);
  13. //是否显示加载中 的方法 调用store中的mutations方法
  14. function loadings(tf){
  15. store.commit("switch_loading",tf);
  16. }
  17. //也挂在到原型链上 方便在每个页面中 使用 this.$loading() 去显示加载中
  18. Vue.prototype.$loading = loadings;
  19. Vue.config.productionTip = false
  20. Vue.prototype.$store = store
  21. Vue.prototype.getDicts = getDicts
  22. App.mpType = 'app'
  23. const app = new Vue({
  24. ...App
  25. })
  26. app.$mount()