Open
Conversation
Contributor
|
我看代码了, 你应该没有理解中间的处理流程. 首先, 多图上传每一项图片的成功失败还是对于整个组件(一次性上传多图)成功失败. 你的钩子也没有考虑到用户使用 async 函数的模式. 并且添加的地方是单个图片处理结束的地方. 图片上传逻辑有做一层代理, 也就是如果连续多次调用图片上传, 那么一定数量内图片上传的请求会合并为一个. 可以详细查看以下几个方法 uploadCatch, originUpload, uploadImg 的处理 |
Contributor
Author
|
是单个图片上传完成状态的钩子,用户关心的也应该是单个图片的上传状态。
多图片上传合并为一个请求是底层实现。且如果在这里(uploadCatch)设置钩子,当单次上传文件数量超出 uploadLimit 会多次触发钩子。
这里没太理解什么意思 |
Contributor
|
这个需求确实有道理, 就是我感觉你的实现方式并不是很完美. 有些问题可以考虑更细致一点. 那另一个问题, 你想的是提供hook, 为什么不是事件呢? |
Contributor
Author
|
这个参考了elementui |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.