多租户商城-商户小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
579 B

2 years ago
  1. import Vue from 'vue'
  2. import store from "../../store";
  3. export function showLoading(info=''){
  4. store.commit("SET_SHOW_LOADING",{flag:true,info})
  5. }
  6. export function hideLoading(){
  7. store.commit("SET_SHOW_LOADING",{flag:false,info:''})
  8. }
  9. export function showLoadingAuto(info='',time = 2000){
  10. store.commit("SET_SHOW_LOADING",{flag:true,info})
  11. setTimeout(()=>{
  12. store.commit("SET_SHOW_LOADING",{flag:false,info:''})
  13. },time)
  14. }
  15. Vue.prototype.$showLoading = showLoading
  16. Vue.prototype.$hideLoading = hideLoading
  17. Vue.prototype.$showLoadingAuto = showLoadingAuto