Skip to content

Commit 65b744d

Browse files
committed
doc: 更新示例
1 parent 272ce3e commit 65b744d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/BootstrapBlazor.Server/Components/Samples/UploadDrops.razor.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ public partial class UploadDrops
2020
private Task OnDropUpload(UploadFile file)
2121
{
2222
// 模拟保存文件等处理
23-
return Task.Delay(1000);
23+
if (file.File is { Size: > 5 * 1024 * 1024 })
24+
{
25+
file.Code = 1004;
26+
ToastService.Information("Error", Localizer["DropUploadFooterText"]);
27+
}
28+
return Task.CompletedTask;
2429
}
2530

2631
private List<AttributeItem> GetAttributes() =>

0 commit comments

Comments
 (0)