Skip to content

Commit

Permalink
doc(CardUpload): update documation (#4373)
Browse files Browse the repository at this point in the history
* doc: 更新示例上传文件限制更改为 5M

* feat: 增加 AutoResetWhenInvalid 参数

* doc: 代码格式化

* Revert "feat: 增加 AutoResetWhenInvalid 参数"

This reverts commit 8798549.

* chore: bump version 8.10.1
  • Loading branch information
ArgoZhang authored Sep 27, 2024
1 parent 5c629bb commit 10b6629
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public sealed partial class Uploads

private CancellationTokenSource? ReadToken { get; set; }

private static long MaxFileLength => 200 * 1024 * 1024;
private static long MaxFileLength => 5 * 1024 * 1024;

private Person Foo1 { get; set; } = new Person();

Expand Down Expand Up @@ -184,7 +184,7 @@ private async Task OnCardUpload(UploadFile file)
{
if (file != null && file.File != null)
{
// 服务器端验证当文件大于 2MB 时提示文件太大信息
// 服务器端验证当文件大于 5MB 时提示文件太大信息
if (file.Size > MaxFileLength)
{
await ToastService.Information(Localizer["UploadsFileMsg"], Localizer["UploadsFileError"]);
Expand Down
4 changes: 2 additions & 2 deletions src/BootstrapBlazor.Server/Locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -3387,7 +3387,7 @@
"UploadPreCardStyleWasm": "<b>Wasm mode </b>",
"UploadPreCardStyleWasmSide": "It wasn't available in <code>wasm</code> mode, <code>IWebHostEnvironment</code> needed to save files to the server side by calling <code>webapi</code> interface, and so on",
"UploadPreCardStyleLink": "Interested students can view their knowledge of <code>Upload</code> components through the <code>wiki</code> in the open source repository related resources of the <a href='{0}' target='_blank'>[The portal]</a>",
"UploadPreCardStyleValidation": "In this example, server-side verification prompts the file for too much prompt when the file size exceeds <code>200MB</code>",
"UploadPreCardStyleValidation": "In this example, server-side verification prompts the file for too much prompt when the file size exceeds <code>5MB</code>",
"UploadPreCardStyleTips1": "In this example, the <code>ShowProgress=true</code> display upload progress bar",
"UploadPreCardStyleTips2": "When you set up <code>IsSingle</code>, you can upload only one image or file",
"UploadFileIconTitle": "The file icon",
Expand Down Expand Up @@ -3425,7 +3425,7 @@
"UploadsFormatError": "The file format is incorrect",
"UploadsAvatarMsg": "Avatar upload",
"UploadsFileMsg": "Upload the file",
"UploadsFileError": "The file size is greater than 200MB",
"UploadsFileError": "The file size is greater than 5MB",
"UploadsSaveFileError": "Failed to save the file",
"UploadFile": "Upload the file",
"UploadsWasmError": "Wasm mode does not implement saving code",
Expand Down
4 changes: 2 additions & 2 deletions src/BootstrapBlazor.Server/Locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -3387,7 +3387,7 @@
"UploadPreCardStyleWasm": "<b>Wasm 模式</b>",
"UploadPreCardStyleWasmSide": "<code>wasm</code> 模式中无法使用 <code>IWebHostEnvironment</code> 需要调用 <code>webapi</code> 接口等形式将文件保存到服务器端",
"UploadPreCardStyleLink": "有兴趣的同学可以通过开源仓库中的 <code>wiki</code> 文档中相关资源查看关于 <code>Upload</code> 组件的相关知识技巧 <a href='{0}' target='_blank'>[传送门]</a>",
"UploadPreCardStyleValidation": "本例中通过服务器端验证当文件大小超过 <code>200MB</code> 时,提示文件太大提示信息",
"UploadPreCardStyleValidation": "本例中通过服务器端验证当文件大小超过 <code>5MB</code> 时,提示文件太大提示信息",
"UploadPreCardStyleTips1": "本例中设置 <code>ShowProgress=true</code> 显示上传进度条",
"UploadPreCardStyleTips2": "设置 <code>IsSingle</code> 时,仅可以上传一张图片或者文件",
"UploadFileIconTitle": "文件图标",
Expand Down Expand Up @@ -3425,7 +3425,7 @@
"UploadsFormatError": "文件格式不正确",
"UploadsAvatarMsg": "头像上传",
"UploadsFileMsg": "上传文件",
"UploadsFileError": "文件大小超过 200MB",
"UploadsFileError": "文件大小超过 5MB",
"UploadsSaveFileError": "保存文件失败",
"UploadFile": "上传文件",
"UploadsWasmError": "Wasm 模式未实现保存代码",
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/BootstrapBlazor.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>8.9.4</Version>
<Version>8.10.1</Version>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
Expand Down
3 changes: 2 additions & 1 deletion src/BootstrapBlazor/Components/Upload/ButtonUploadBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ protected override async Task OnFileChange(InputFileChangeEventArgs args)
}
file.Uploaded = true;
}
//触发ValueChange,以支持bing-value

//触发 ValueChange,以支持 bind-value
await base.OnFileChange(args);
}

Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/Components/Upload/UploadBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ protected virtual async Task<bool> OnFileDelete(UploadFile item)
}

/// <summary>
///
/// 上传文件改变时回调此方法
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
Expand Down

0 comments on commit 10b6629

Please sign in to comment.