多租户商城-商户小程序端
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.

24 lines
701 B

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