We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.6.4
chrome88
https://www.antdv.com/components/upload-cn/#components-upload-demo-transform-file-before-request
<a-upload :action="actionUrl" list-type="picture-card" :file-list="fileList" name="files" multiple @Preview="handlePreview" @change="handleChange" :before-upload="beforeUpload" :headers="uploadHeader" :transform-file="transformFile"
transformFile(file) { console.log('压缩前', file);
return new Promise( (resolve, reject) => { try { imageConversion.compressAccurately(file, 400).then(res => { // console.log(res) res = new File([res], file.name, {type: res.type, lastModified: Date.now()}) console.log('压缩后', res); resolve(res) }) } catch (e) { reject(e) }
}) },
图片压缩
transformFile没有执行
The text was updated successfully, but these errors were encountered:
fix: transformFile not work #3636
22dccf4
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Sorry, something went wrong.
No branches or pull requests
Version
1.6.4
Environment
chrome88
Reproduction link
https://www.antdv.com/components/upload-cn/#components-upload-demo-transform-file-before-request
Steps to reproduce
<a-upload
:action="actionUrl"
list-type="picture-card"
:file-list="fileList"
name="files"
multiple
@Preview="handlePreview"
@change="handleChange"
:before-upload="beforeUpload"
:headers="uploadHeader"
:transform-file="transformFile"
transformFile(file) {
console.log('压缩前', file);
return new Promise( (resolve, reject) => {
try {
imageConversion.compressAccurately(file, 400).then(res => { // console.log(res)
res = new File([res], file.name, {type: res.type, lastModified: Date.now()})
console.log('压缩后', res);
resolve(res)
})
} catch (e) {
reject(e)
}
})
},
What is expected?
图片压缩
What is actually happening?
transformFile没有执行
The text was updated successfully, but these errors were encountered: