Version
undefined
Environment
"vue": "^2.6.10", Google Chrome版本 81.0.4044.138(正式版本) (64 位)
Reproduction link
https://www.antdv.com/components/upload-cn/
Steps to reproduce
<a-upload
name="avatar"
list-type="text"
:multiple="false"
:default-file-list="fileList"
:before-upload="beforeUploadManual"
@change="handleChangeManual"
导入文档
beforeUploadManual(file) {
const fileType = file.type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' || file.type === 'application/msword'
if (!fileType) {
this.$message.error('只能上传word文档')
}
const fileNum = this.fileList.length
if (fileNum > 0) {
this.fileList.splice(fileNum - 1, 1)
}
return fileType
},
Prompt "only word document can be uploaded", but the selected file is still uploaded to the page
What is expected?
After the beforeupload function returns false, the file will not be uploaded to the page
What is actually happening?
After the beforeupload function returns false, the file will be uploaded to the page