Blame view

ceres-uniapp-master/components/GlobalLoading/index.js 701 Bytes
3f535f30   杨鑫   '初始'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  import Vue from 'vue'
  import store from "../../store";
  import GlobalLoading from "./index.vue";
  export function showLoading(info=''){
      store.commit("SET_SHOW_LOADING",{flag:true,info})
  }
  
  export function hideLoading(){
      store.commit("SET_SHOW_LOADING",{flag:false,info:''})
  }
  
  export function showLoadingAuto(info='',time = 2000){
      store.commit("SET_SHOW_LOADING",{flag:true,info})
      setTimeout(()=>{
          store.commit("SET_SHOW_LOADING",{flag:false,info:''})
      },time)
  }
  
  Vue.prototype.$showLoading = showLoading
  Vue.prototype.$hideLoading = hideLoading
  Vue.prototype.$showLoadingAuto = showLoadingAuto
  // Vue.component("globalLoading",GlobalLoading)
  
  // export default GlobalLoading