Skip to content

upload.js组件remove方法问题 #259

@luoyang125024608

Description

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

Version

1.1.7

Environment

any

Reproduction link

https://tangjinzhou.gitee.io/ant-design-vue/components/upload-cn/

Steps to reproduce

/* this.$emit('remove', file) , return value is this , not Boolean or Promise */
handleRemove: function handleRemove(file) {
var _this2 = this;

Promise.resolve(this.$emit('remove', file)).then(function (ret) {
// Prevent removing file
if (ret === false) {
return;
}

var removedFileList = (0, _utils.removeFileItem)(file, _this2.sFileList);
if (removedFileList) {
_this2.onChange({
file: file,
fileList: removedFileList
});
}
});
},

What is expected?

ret : Boolean or Promise

What is actually happening?

ret : this === Component

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions