当前位置:   article > 正文

vue中elementUI的Loading.service函数的封装

loading.service
  1. import { Loading } from 'element-ui';
  2. const loadOption={fullscreen: true ,lock: true, text: 'Loading', spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0.7)'}
  3. let loadingInstance;
  4. export default class loadEvents {
  5. constructor(vueThis){
  6. this.vm = vueThis ; //vue中的this 也可以不用
  7. }
  8. open(){
  9. loadingInstance = Loading.service(loadOption);
  10. }
  11. close(){
  12. loadingInstance.close();
  13. }
  14. }
  15. //loads.open();loading效果出现;loads.close();关闭loading效果

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/447581
推荐阅读
相关标签
  

闽ICP备14008679号