-
Notifications
You must be signed in to change notification settings - Fork 14.6k
upload: add before-remove function #8788
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
Conversation
@Leopoldthecoder Both Chinese and English document are updated. But I was not able to translate it to Spanish. So I just Keep it for others folks. |
fa550b0
to
219de55
Compare
219de55
to
d05ff36
Compare
packages/upload/src/index.vue
Outdated
doRemove(); | ||
}, () => { | ||
// do nothing | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use noop
here:
before.then(() => {
doRemove();
}, noop);
packages/upload/src/index.vue
Outdated
doRemove(); | ||
} else { | ||
// do nothing | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This else
block can be removed entirely.
examples/docs/en-US/upload.md
Outdated
handleBeforeRemove(file, fileList) { | ||
return new Promise((resolve, reject) => { | ||
if (confirm('It looks good, are you sure to remove?')) { | ||
resolve() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a semicolon here. Also applies to the other 7 resolve()
s and reject()
s.
Thanks for contributing. |
upload: add before-remove function. It can support a function returns a boolean or Promise.
#8399 requests this feature.
Please make sure these boxes are checked before submitting your PR, thank you!
dev
branch.