Skip to content

Commit

Permalink
fix: 修复 Upload 组件value undifined 场景校验失败问题
Browse files Browse the repository at this point in the history
  • Loading branch information
honkinglin committed May 9, 2022
1 parent fa73fbe commit 05449e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/upload/hooks/useSizeLimit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function useHandleLimit() {
const [local, t] = useLocaleReceiver('upload');
return handleSizeLimit;

function handleSizeLimit(fileSize: number, rawSizeLimit: SizeLimitObj | number) {
function handleSizeLimit(fileSize = 0, rawSizeLimit: SizeLimitObj | number) {
const sizeLimit: SizeLimitObj =
typeof rawSizeLimit === 'number' ? { size: rawSizeLimit, unit: 'KB' } : rawSizeLimit;
sizeLimit.unit = sizeLimit.unit.toUpperCase() as SizeUnit;
Expand Down

0 comments on commit 05449e7

Please sign in to comment.