Skip to content

Commit

Permalink
feat(useUpload): support max size
Browse files Browse the repository at this point in the history
  • Loading branch information
nemo-shen committed Feb 16, 2024
1 parent 5b62a08 commit bc3b57c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/core/useUpload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ export const useUpload = (options: UseUploadOptions): UseUploadReturn => {
if (!(appendFiles as File[]).every(validFileType)) {
throw new Error('Have some File reject')
}
if (!(appendFiles as File[]).every((f) => f.size <= maxSize)) {
throw new Error('Have some File size exceed')
}

files.value = [
...files.value,
Expand Down

0 comments on commit bc3b57c

Please sign in to comment.