Skip to content

Commit f4d37e9

Browse files
committed
refactor: 重构代码
1 parent 051c1d2 commit f4d37e9

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/BootstrapBlazor/Components/Upload/UploadBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ public abstract class UploadBase<TValue> : ValidateBase<TValue>, IUpload
128128
/// <returns></returns>
129129
protected async Task OnFileChange(InputFileChangeEventArgs args)
130130
{
131-
UploadFiles.Clear();
132131
var fileCount = MaxFileCount ?? args.FileCount;
133132
var items = args.GetMultipleFiles(fileCount).Select(f =>
134133
{
@@ -234,9 +233,10 @@ protected void Update(UploadFile file)
234233
/// </summary>
235234
protected virtual bool CheckCanUpload()
236235
{
236+
// 如果组件禁用了 IsDisabled 允许上传但是不出现 + 按钮
237237
if (IsDisabled)
238238
{
239-
return false;
239+
return true;
240240
}
241241

242242
// 允许多上传

src/BootstrapBlazor/Extensions/UploadFileExtensions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ public static async Task RequestBase64ImageFileAsync(this UploadFile upload, str
5454
/// <param name="maxAllowedSize"></param>
5555
/// <param name="token"></param>
5656
/// <returns></returns>
57-
[ExcludeFromCodeCoverage]
5857
public static async Task<bool> SaveToFileAsync(this UploadFile upload, string fileName, long maxAllowedSize = 512000, CancellationToken token = default)
5958
{
6059
var ret = false;
@@ -130,7 +129,6 @@ public static async Task<bool> SaveToFileAsync(this UploadFile upload, string fi
130129
/// <param name="maxAllowedSize"></param>
131130
/// <param name="token"></param>
132131
/// <returns></returns>
133-
[ExcludeFromCodeCoverage]
134132
public static async Task<byte[]?> GetBytesAsync(this UploadFile upload, string format, int maxWidth, int maxHeight, long maxAllowedSize = 512000, CancellationToken token = default)
135133
{
136134
byte[]? ret = null;

0 commit comments

Comments
 (0)