import Vue from 'vue' import App from './App' import store from './store' // store import plugins from './plugins' // plugins import './permission' // permission import { getDicts } from "@/api/system/dict/data" Vue.use(plugins) /** * 引用全局加载 loading * */ import loading from "./components/loading/loading.vue" Vue.component('loading',loading); //是否显示加载中 的方法 调用store中的mutations方法 function loadings(tf){ store.commit("switch_loading",tf); } //也挂在到原型链上 方便在每个页面中 使用 this.$loading() 去显示加载中 Vue.prototype.$loading = loadings; Vue.config.productionTip = false Vue.prototype.$store = store Vue.prototype.getDicts = getDicts App.mpType = 'app' const app = new Vue({ ...App }) app.$mount()