代码只会copy
代码只会copy
  • 发布:2018-12-18 14:11
  • 更新:2021-06-08 13:21
  • 阅读:2327

uni.saveFile 怎么同步保存

分类:uni-app

for (var i = 0; i < imageListlength; i++)
{
uni.saveFile({
tempFilePath: this.imageList[i],
success: function(res) {
list.push(res.savedFilePath);
},
complete: function(res) {}
});
}

this.piclocalpath = list;//没保存完就执行这句了

2018-12-18 14:11 负责人:无 分享
已邀请:
虫雪浓

虫雪浓 - 热爱生活,热爱编程

for (var i = 0; i < imageListlength; i++) {  
  
  uni.saveFile({  
  
    tempFilePath: this.imageList[i],  
  
    success: function(res) {  
  
        this.piclocalpath.push(res.savedFilePath);  
  
      },  
  
      complete: function(res) {}  
  
  });  
  
}  
  

1***@qq.com

1***@qq.com

监听this.piclocalpath长度与imageListlength长度一致时代表下载完成

该问题目前已经被锁定, 无法添加新回复