!3667 doc(#I67BCY): update AutoRedirect Demo

* doc: 增加注释
* doc: 格式化文档
* Merge remote-tracking branch 'origin/main' into I67BCY-AutoRedirect
* update AutoRedirect Demo
This commit is contained in:
代码搬运工 2022-12-24 15:16:08 +00:00 committed by Argo
parent f1201feecd
commit d4f92c3d96
5 changed files with 27 additions and 24 deletions

View File

@ -0,0 +1,14 @@
<AutoRedirect Interval="3000" RedirectUrl="/" OnBeforeRedirectAsync="@OnBeforeRedirectAsync" />
<BlockLogger @ref="Trace" />
@code {
[NotNull]
private BlockLogger? Trace { get; set; }
private Task<bool> OnBeforeRedirectAsync()
{
Trace.Log("Ready to redirect");
return Task.FromResult(true);
}
}

View File

@ -4128,10 +4128,10 @@
"P16": "set up"
},
"BootstrapBlazor.Shared.Samples.AutoRedirects": {
"H1": "AutoRedirect automatic jump component",
"H2": "Through the set address, automatically jump to the specified page when there is no mouse or keyboard action on the page",
"P1": "Common usage",
"P2": "By setting the <code>Interval</code> interval, when there is no mouse or keyboard action, it will automatically jump to the address set by <code>RedirectUrl</code>"
"Title": "AutoRedirect automatic jump component",
"Description": "Through the set address, automatically jump to the specified page when there is no mouse or keyboard action on the page",
"NormalTitle": "Common usage",
"NormalIntro": "By setting the <code>Interval</code> interval, when there is no mouse or keyboard action, it will automatically jump to the address set by <code>RedirectUrl</code>"
},
"BootstrapBlazor.Shared.Samples.AnchorLinks": {
"AnchorLinkTitle": "AnchorLink",

View File

@ -4129,10 +4129,10 @@
"P16": "设置"
},
"BootstrapBlazor.Shared.Samples.AutoRedirects": {
"H1": "AutoRedirect 自动跳转组件",
"H2": "通过设置的地址,当页面无鼠标或者键盘动作时自动跳转到指定页面",
"P1": "普通用法",
"P2": "通过设置 <code>Interval</code> 间隔,当无鼠标或者键盘动作时自动跳转到 <code>RedirectUrl</code> 设置的地址"
"Title": "AutoRedirect 自动跳转组件",
"Description": "通过设置的地址,当页面无鼠标或者键盘动作时自动跳转到指定页面",
"NormalTitle": "普通用法",
"NormalIntro": "通过设置 <code>Interval</code> 间隔,当无鼠标或者键盘动作时自动跳转到 <code>RedirectUrl</code> 设置的地址"
},
"BootstrapBlazor.Shared.Samples.AnchorLinks": {
"AnchorLinkTitle": "AnchorLink 锚点链接",

View File

@ -1,12 +1,10 @@
@page "/autoredirects"
@inject IStringLocalizer<AutoRedirects> Localizer
<h3>@Localizer["H1"]</h3>
<h4>@Localizer["H2"]</h4>
<h3>@Localizer["Title"]</h3>
<h4>@Localizer["Description"]</h4>
<DemoBlock Title="@Localizer["P1"]" Introduction="@Localizer["P2"]" Name="Normal">
<AutoRedirect Interval="3000" RedirectUrl="/" OnBeforeRedirectAsync="@OnBeforeRedirectAsync" />
<BlockLogger @ref="Trace" />
</DemoBlock>
<DemoBlock Title="@Localizer["NormalTitle"]" Introduction="@Localizer["NormalIntro"]"
Name="Normal" Demo="AutoRedirect.AutoRedirectNormal" />
<AttributeTable Items="@GetAttributes()" />

View File

@ -5,19 +5,10 @@
namespace BootstrapBlazor.Shared.Samples;
/// <summary>
///
/// AutoRedirects
/// </summary>
public partial class AutoRedirects
{
[NotNull]
private BlockLogger? Trace { get; set; }
private Task<bool> OnBeforeRedirectAsync()
{
Trace.Log("准备跳转地址");
return Task.FromResult(true);
}
/// <summary>
/// Get property method
/// </summary>