mirror of
https://gitee.com/LongbowEnterprise/BootstrapBlazor.git
synced 2024-12-05 21:50:05 +08:00
!3527 doc(#I60WL6): update sample code for RibbonTab component
* doc: 增加 FloatChanged 示例 * doc: 更新示例移除不使用的样式 * doc: 更改 OnHeaderClickAsync 为 OnMenuClickAsync
This commit is contained in:
parent
acf3a5de01
commit
db74615b9d
@ -11,11 +11,11 @@
|
||||
|
||||
<DemoBlock Title="@Localizer["P4"]" Introduction="@Localizer["P5"]" Name="Float">
|
||||
<div class="ribbon-demo">
|
||||
<RibbonTab Items="@Items" ShowFloatButton="true" />
|
||||
<div class="ribbon-demo-body">
|
||||
<RibbonTab Items="@Items" ShowFloatButton="true" OnFloatChanged="OnFloatChanged">
|
||||
@Localizer["P6"]
|
||||
</div>
|
||||
</RibbonTab>
|
||||
</div>
|
||||
<BlockLogger @ref="Logger" />
|
||||
</DemoBlock>
|
||||
|
||||
<DemoBlock Title="@Localizer["P7"]" Introduction="@Localizer["P8"]" Name="RightButtonsTemplate">
|
||||
@ -30,7 +30,7 @@
|
||||
</DemoBlock>
|
||||
|
||||
<DemoBlock Title="@Localizer["HeaderClickTitle"]" Introduction="@Localizer["HeaderClickIntro"]" Name="HeaderClick">
|
||||
<RibbonTab Items="@Items" OnHeaderClickAsync="@OnHeaderClickAsync">
|
||||
<RibbonTab Items="@Items" OnMenuClickAsync="@OnMenuClickAsync">
|
||||
<div class="@FileClassString">@Localizer["ItemsText1"]</div>
|
||||
<div class="@EditClassString">@Localizer["ItemsText2"]</div>
|
||||
</RibbonTab>
|
||||
|
@ -60,13 +60,22 @@ public partial class RibbonTabs
|
||||
.AddClass("show", ActiveTabText == Localizer["ItemsText2"])
|
||||
.Build();
|
||||
|
||||
private Task OnHeaderClickAsync(string text, string url)
|
||||
private Task OnMenuClickAsync(string text, string url)
|
||||
{
|
||||
ActiveTabText = text;
|
||||
StateHasChanged();
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
[NotNull]
|
||||
private BlockLogger? Logger { get; set; }
|
||||
|
||||
private Task OnFloatChanged(bool @float)
|
||||
{
|
||||
Logger.Log($"Float: {@float}");
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private IEnumerable<AttributeItem> GetAttributes() => new AttributeItem[]
|
||||
{
|
||||
new AttributeItem()
|
||||
|
@ -1,7 +1,3 @@
|
||||
.ribbon-demo {
|
||||
height: 196px;
|
||||
}
|
||||
|
||||
.ribbon-demo-body {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user