Vue为什么重新定义了一个循环变量?
发布于 2 个月前 作者 ab8512 117 次浏览 来自 问答
2 回复

你把methods里写的函数源码贴一下

setConfirm:function () { this.$store.state.uploadDialogVisible = false; if(this.types.image.fileList.length>0&&this.types.pointcloud.fileList.length>0){ for(let ii = this.types.image.fileList.length; ii>0; --ii){ this.loadImage(this.types.image.fileList[ii]); } //this.$store.state.images.addFiles(this.types.image.fileList); this.$store.state.pointclouds.addFiles(this.types.pointcloud.fileList); if(this.$route.meta.title!==‘union’){ this.$router.push(’./union’); }

        }else if(this.types.image.fileList.length>0){
          for(let ij = this.types.image.fileList.length; ij>0; --ij){
            this.loadImage(this.types.image.fileList[ij]);
          }
          if(this.$route.meta.title!=='image'){
            this.$router.push('./image');
          }
        }else if(this.types.pointcloud.fileList.length>0){
          this.$store.state.pointclouds.addFiles(this.types.pointcloud.fileList);
          if(this.$route.meta.title!=='pointcloud'){
            this.$router.push('./pointcloud');
          }

        }
        if(this.types.labeled.fileList.length>0){
          this.$store.state.labels.addFiles(this.types.labeled.fileList);
        }
    },
回到顶部