Blame view

ceres-uniapp-master/utils/plugIn/globalLoading.js 579 Bytes
3f535f30   杨鑫   '初始'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  import Vue from 'vue'
  import store from "../../store";
  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