refreshData(file){
return new Promise((resolve) => {
compress(file, {
compress: {
// width: 1600,
// height: 1600,
quality: 1
// quality: 1
}
}, function (file) {
console.log("fffff", file)
resolve(file)
})
});
},
提交前
let ansArr = []
this.tmpArray.forEach((obj,index) => {
this.refreshData(obj).then(file => {
ansArr.push(file)
console.log("ansArr", ansArr.length)
if (index == this.tmpArray.length - 1) {
console.log("后续")
}
})
})