Skip to content
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

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

Closed
1 task
luoyang125024608 opened this issue Nov 14, 2018 · 2 comments
Closed
1 task

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

luoyang125024608 opened this issue Nov 14, 2018 · 2 comments
Labels

Comments

@luoyang125024608
Copy link

luoyang125024608 commented Nov 14, 2018

  • 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

@tangjinzhou
Copy link
Member

@wangxueliang $emit的返回值是this,这是vue的特性,改用回调方式吧

@github-actions
Copy link

github-actions bot commented Apr 2, 2020

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 Apr 2, 2020
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