美文网首页
vant增加全局遮罩层并且带有loading加载中

vant增加全局遮罩层并且带有loading加载中

作者: jesse28 | 来源:发表于2022-01-20 11:50 被阅读0次

    参考文章:https://www.cnblogs.com/missile/p/12706118.html
    methods方法中先引入这两个方法

       showloading() {
          var title = "加载中···";
          this.$showLoading({
            title: title,
          });
        },
        hideloading() {
          this.$cancelLoading();
        },
    

    然后在上传方法中调用这两个方法

     apiFileJavaUpload("caseSimpleFile", 0, { file: e.files })
                    .then((res) => {
                      self.showloading();
                      if (res.statusCode == 200) {
                        console.log("上传照片", res);
                        self.hideloading();
                      }
                      if (window.plus) {
                        plus.nativeUI.closeWaiting();
                      }
                      let value = res.resMap.fileIdList;
                      self.$emit("responseFun", value);
                    })
                    .catch(() => {
                      if (window.plus) {
                        plus.nativeUI.closeWaiting();
                      }
                    });
                }
    

    相关文章

      网友评论

          本文标题:vant增加全局遮罩层并且带有loading加载中

          本文链接:https://www.haomeiwen.com/subject/qpdjhrtx.html