Skip to content

Commit 6864130

Browse files
committed
doc: 更新示例文档
1 parent 31604f4 commit 6864130

File tree

4 files changed

+12
-28
lines changed

4 files changed

+12
-28
lines changed

src/BootstrapBlazor.Server/Components/Samples/TextAreas.razor

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,12 @@
5757
</section>
5858
</DemoBlock>
5959

60-
<DemoBlock Title="@Localizer["TextAreaKeyUpTitle"]"
61-
Introduction="@Localizer["TextAreaKeyUpIntro"]"
62-
Name="KeyUp">
60+
<DemoBlock Title="@Localizer["TextAreaUseShiftEnterTitle"]"
61+
Introduction="@Localizer["TextAreaUseShiftEnterIntro"]"
62+
Name="UseShiftEnter">
6363
<Textarea rows="4" autocomplete="off" autocorrect="off" spellcheck="false"
64-
UseInputEvent="true" UseShiftEnter="true" PlaceHolder="@Localizer["TextAreaKeyUpPlaceHolder"]"
64+
UseInputEvent="true" UseShiftEnter="true" PlaceHolder="@Localizer["TextAreaUseShiftEnterPlaceHolder"]"
6565
@bind-Value="@KeyText"></Textarea>
66-
<section ignore>
67-
<ConsoleLogger @ref="Logger" IsHtml="true" />
68-
</section>
6966
</DemoBlock>
7067

7168
<AttributeTable Items="@GetAttributes()" />

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

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -92,25 +92,6 @@ private void MockChat()
9292
}
9393
}
9494

95-
[NotNull]
96-
private ConsoleLogger? Logger { get; set; }
97-
98-
private Task<bool> OnKeyDownAsync(KeyboardEventArgs args)
99-
{
100-
var ret = true;
101-
if (args.ShiftKey && args.Key == "Enter")
102-
{
103-
Text += $"{Environment.NewLine}";
104-
Logger.Log("Press <kbd>Shift</kbd> + <kbd>Enter</kbd>");
105-
StateHasChanged();
106-
}
107-
else if (args.Key == "Enter")
108-
{
109-
Logger.Log("Press <kbd>Enter</kbd>: call some method.");
110-
}
111-
return Task.FromResult(ret);
112-
}
113-
11495
/// <summary>
11596
/// Dispose
11697
/// </summary>

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3280,7 +3280,10 @@
32803280
"TextAreaScrollToBottom": "Scroll to bottom",
32813281
"TextAreaScrollToTop": "Scroll to top",
32823282
"TextAreaScrollTo": "Scroll +20",
3283-
"TextAreaAutoScroll": "Automatic scrolling"
3283+
"TextAreaAutoScroll": "Automatic scrolling",
3284+
"TextAreaUseShiftEnterTitle": "Shift Enter",
3285+
"TextAreaUseShiftEnterIntro": "By setting <code>UseShiftEnter=\"true\"</code> you can start using <kbd>Shift</kbd> + <kbd>Enter</kbd> for line breaks, which is suitable for dialog applications.",
3286+
"TextAreaUseShiftEnterPlaceHolder": "Please enter some text, Enter sends Shift + Enter line break"
32843287
},
32853288
"BootstrapBlazor.Server.Components.Samples.Toggles": {
32863289
"TogglesOnText": "On",

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3280,7 +3280,10 @@
32803280
"TextAreaScrollToBottom": "滚动到底部",
32813281
"TextAreaScrollToTop": "滚动到顶部",
32823282
"TextAreaScrollTo": "滚动+20",
3283-
"TextAreaAutoScroll": "自动滚屏"
3283+
"TextAreaAutoScroll": "自动滚屏",
3284+
"TextAreaUseShiftEnterTitle": "Shift Enter",
3285+
"TextAreaUseShiftEnterIntro": "通过设置 <code>UseShiftEnter=\"true\"</code> 开始使用 <kbd>Shift</kbd> + <kbd>Enter</kbd> 进行换行操作,适用于对话框类应用",
3286+
"TextAreaUseShiftEnterPlaceHolder": "请输入一些文字,Enter 发送 Shift + Enter 换行"
32843287
},
32853288
"BootstrapBlazor.Server.Components.Samples.Toggles": {
32863289
"TogglesOnText": "开启",

0 commit comments

Comments
 (0)