Skip to content

Upload上传文件 promise方式不生效 #2358

@bigarmy2020

Description

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

Version

1.6.1

Environment

os: 10.15.5, chrome: 83.0.4103.61, vue: 2.6.11

Reproduction link

https://github.com/bigarmy2020/upload-demo

Steps to reproduce

<a-upload-dragger
:name="name"
:action="uploadAction"
:headers="headers"
:data="{ biz: bizPath }"
:disabled="disabled"
:multiple="isMultiple"
:file-list="fileList"
:default-value="fileList"
:class="{ 'has-error': hasError }"
:beforeUpload="innerBeforeUpload"
@preview="handlePreview"
@change="handleChange"
>

innerBeforeUpload(file) {
return new Promise((resolve, reject) => {
this.$message.error('上传图片格式不对!');
return reject(false);
});
},

结果地址

What is expected?

期望reject 能阻止上传

What is actually happening?

BeforeUpload 用 promise写死 未能成功阻止

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions