Skip to content

Commit 3df4c80

Browse files
committed
feat: 更新说明文档
1 parent 6281ce3 commit 3df4c80

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<PackageReference Include="BootstrapBlazor.Sortable" Version="9.0.3" />
7171
<PackageReference Include="BootstrapBlazor.Splitting" Version="9.0.3" />
7272
<PackageReference Include="BootstrapBlazor.SvgEditor" Version="9.0.3" />
73-
<PackageReference Include="BootstrapBlazor.SummerNote" Version="9.0.5" />
73+
<PackageReference Include="BootstrapBlazor.SummerNote" Version="9.0.6" />
7474
<PackageReference Include="BootstrapBlazor.TableExport" Version="9.2.6" />
7575
<PackageReference Include="BootstrapBlazor.Tasks.Dashboard" Version="9.0.0" />
7676
<PackageReference Include="BootstrapBlazor.TcpSocket" Version="9.0.0" />

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,15 @@ private async Task InsertHtmlAsync()
111111
await Editor.DoMethodAsync("pasteHTML", $"<h1>{Localizer["DoMethodAsyncPasteHTML"]}</h1>");
112112
}
113113

114-
private async Task OnFileUpload(EditorUploadFile uploadFile)
114+
private async Task<string> OnFileUpload(EditorUploadFile uploadFile)
115115
{
116116
var url = Path.Combine("images", "uploader", $"{Path.GetFileNameWithoutExtension(uploadFile.FileName)}-{DateTimeOffset.Now:yyyyMMddHHmmss}{Path.GetExtension(uploadFile.FileName)}");
117117
var fileName = Path.Combine(WebsiteOption.CurrentValue.WebRootPath, url);
118118
await uploadFile.SaveToFileAsync(fileName);
119+
120+
// 此处返回空字符串底层使用 URL.createObjectURL 方法创建 Blob 对象地址
121+
// 实战中可以返回 SSO 地址或者 base64 字符串等
122+
return "";
119123
}
120124

121125
private string? _editorCode;

src/BootstrapBlazor.Server/Locales/en-US.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2536,7 +2536,7 @@
25362536
"EditorPlaceholderIntro": "The prompt message when a null value is set by setting the <code>Placeholder</code> attribute",
25372537
"EditorPlaceholderDescription": "The default prompt is <b>Edit after clicking</b>",
25382538
"EditorIsEditorTitle": "Display as a rich text edit box by default",
2539-
"EditorIsEditorIntro": "Set the component to be directly displayed as a rich text edit box by setting the <code>IsEditor</code> property",
2539+
"EditorIsEditorIntro": "Set the component to be directly displayed as a rich text edit box by setting the <code>IsEditor</code> property. When uploading an image, you can get the image information through the <code>OnFileUpload</code> callback method",
25402540
"EditorHeightTitle": "Custom height",
25412541
"EditorHeightIntro": "Set the height of the component by setting the <code>Height</code> property",
25422542
"EditorOnValueChangedTitle": "Two-way binding",

src/BootstrapBlazor.Server/Locales/zh-CN.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2537,7 +2537,7 @@
25372537
"EditorPlaceholderIntro": "通过设置 <code>Placeholder</code> 属性来设置空值时的提示消息",
25382538
"EditorPlaceholderDescription": "默认提示是 <b>点击后进行编辑</b>",
25392539
"EditorIsEditorTitle": "默认显示为富文本编辑框",
2540-
"EditorIsEditorIntro": "通过设置 <code>IsEditor</code> 属性来设置组件直接显示为富文本编辑框",
2540+
"EditorIsEditorIntro": "通过设置 <code>IsEditor</code> 属性来设置组件直接显示为富文本编辑框,上传图片时可以通过 <code>OnFileUpload</code> 回调方法获得图片信息",
25412541
"EditorHeightTitle": "自定义高度",
25422542
"EditorHeightIntro": "通过设置 <code>Height</code> 属性来设置组件高度",
25432543
"EditorOnValueChangedTitle": "双向绑定",

0 commit comments

Comments
 (0)