Skip to content

transformFile不执行 #3636

New issue

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

Closed
1 task
zhangzhenzhi opened this issue Feb 3, 2021 · 1 comment
Closed
1 task

transformFile不执行 #3636

zhangzhenzhi opened this issue Feb 3, 2021 · 1 comment
Labels

Comments

@zhangzhenzhi
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

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没有执行

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants