Skip to content

Commit 50b20cf

Browse files
committed
feat: 增加上传组件数据合规检查逻辑
1 parent 78382e0 commit 50b20cf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/BootstrapBlazor/Components/ValidateForm/ValidateForm.razor.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,9 @@ private async Task ValidateAsync(IValidateComponent validator, ValidationContext
503503
{
504504
// 优先检查 File 流,不需要检查 FileName
505505
ValidateDataAnnotations(file.File, context, messages, pi, file.ValidateId);
506+
507+
// 如果 message 不为空表示验证失败
508+
file.IsValid = messages.Count == 0;
506509
});
507510
}
508511
else

0 commit comments

Comments
 (0)