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

fix(upload): 修复批量上传组件添加同名文件触发额外 onValidate 事件的问题 #1693

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion js/upload/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,9 @@ export function validateFile(
// 上传文件数量限制
let lengthOverLimit = false;
if (max && tmpFiles.length && !params.isBatchUpload) {
const tmpFilesLenToBeAdded = tmpFiles.length;
tmpFiles = tmpFiles.slice(0, max - uploadValue.length);
if (tmpFiles.length !== files.length) {
if (tmpFilesLenToBeAdded + uploadValue.length > max) {
lengthOverLimit = true;
}
}
Expand Down
Loading