Skip to content

Upload组件:当 uploadTrigger 属性设置为 custom 时 afterUpload、onSuccess及onError怎么不触发了呢 #2765

Answered by pointhalo
acccccccb asked this question in Q&A
Discussion options

You must be logged in to vote

受控使用fileList的情况,你确认一下你在 onChange中是否有正确更新 props.fileList,不然状态是没法扭转的。
受控高于一切,如果你在接收到onChange后,不对props.fileList 数据进行更新,组件是不知道你到底想不想更新的(例如某些场景就是会有用户使用受控fileList阻止某些文件的上传),组件给你展示的永远都是开始上传那一刻而已,是走不到 success的。

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@acccccccb
Comment options

Answer selected by acccccccb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants