main.js 903 B

123456789101112131415161718192021222324252627282930313233343536
  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. Vue.use(plugins)
  7. import {toast} from "@/utils/common.js"
  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. /* if(tf){
  16. store.commit("switch_loading",tf)
  17. }else{
  18. store.commit("switch_loading")
  19. } */
  20. store.commit("switch_loading",tf);
  21. }
  22. //也挂在到原型链上 方便在每个页面中 使用 this.$loading() 去显示加载中
  23. Vue.prototype.$loading = loadings;
  24. Vue.config.productionTip = false
  25. Vue.prototype.$store = store
  26. Vue.prototype.$toast=toast;
  27. App.mpType = 'app'
  28. const app = new Vue({
  29. ...App
  30. })
  31. app.$mount()
  32. export default app