Skip to content

Commit 28cb8d0

Browse files
committed
doc: 更新示例
1 parent 43aaa91 commit 28cb8d0

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

src/BootstrapBlazor.Server/Components/Samples/Table/Tables.razor

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@page "/table"
1+
@page "/table"
22
@inject IStringLocalizer<NavMenu> NavMenuLocalizer
33
@inject IStringLocalizer<Tables> Localizer
44
@inject IStringLocalizer<Foo> FooLocalizer
@@ -68,8 +68,16 @@
6868
<DemoBlock Title="@Localizer["TableBaseSizeTitle"]"
6969
Introduction="@Localizer["TableBaseSizeIntro"]"
7070
Name="TableSize">
71-
<section ignore>@((MarkupString)Localizer["TableBaseSizeDescription"].Value)</section>
72-
<Table TItem="Foo" Items="@Items.Take(3)" IsBordered="true" IsStriped="true" TableSize="TableSize.Compact">
71+
<section ignore>
72+
<p>@((MarkupString)Localizer["TableBaseSizeDescription"].Value)</p>
73+
<div class="row g-3">
74+
<div class="col-12 col-sm-6">
75+
<Switch @bind-Value="@_isCompact" DisplayText="TableSize" />
76+
</div>
77+
</div>
78+
</section>
79+
<Table TItem="Foo" Items="@Items.Take(3)" IsBordered="true" IsStriped="true"
80+
TableSize="@(_isCompact ? TableSize.Compact : TableSize.Normal)" IsMultipleSelect="true">
7381
<TableColumns>
7482
<TableColumn @bind-Field="@context.DateTime" Width="180" Filterable="true" Sortable="true" />
7583
<TableColumn @bind-Field="@context.Name" Filterable="true" />

src/BootstrapBlazor.Server/Components/Samples/Table/Tables.razor.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the Apache 2.0 License
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
@@ -21,6 +21,8 @@ public partial class Tables
2121
[NotNull]
2222
private string? RefreshText { get; set; }
2323

24+
private bool _isCompact = true;
25+
2426
/// <summary>
2527
/// OnInitialized
2628
/// </summary>

0 commit comments

Comments
 (0)