Skip to content

Commit 63f1955

Browse files
committed
doc: 更新示例
1 parent 29d3476 commit 63f1955

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<Table TItem="DynamicObject" DynamicContext="DataTableDynamicContext" IsFixedHeader="true" Height="300" />
1414
</DemoBlock>
1515

16-
<DemoBlock Title="@Localizer["TablesDynamicEditTitle"]"
16+
@* <DemoBlock Title="@Localizer["TablesDynamicEditTitle"]"
1717
Introduction="@Localizer["TablesDynamicEditIntro"]"
1818
Name="Edit">
1919
<section ignore>@((MarkupString)Localizer["TablesDynamicEditDescription"].Value)</section>
@@ -47,5 +47,4 @@
4747
<Table TItem="DynamicObject" DynamicContext="DataTablePageDynamicContext" />
4848
<Pagination PageCount="@PageCount" PageIndex="@PageIndex" OnPageLinkClick="@OnPageLinkClick" class="mt-3" />
4949
</DemoBlock>
50-
51-
50+
*@

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,25 @@ private void CreateContext()
5151
{
5252
context.AddRequiredAttribute(nameof(Foo.DateTime));
5353
// 使用 AutoGenerateColumnAttribute 设置显示名称示例
54-
context.AddAutoGenerateColumnAttribute(nameof(Foo.DateTime), new KeyValuePair<string, object?>[] { new(nameof(AutoGenerateColumnAttribute.Text), Localizer[nameof(Foo.DateTime)].Value) });
54+
context.AddAutoGenerateColumnAttribute(nameof(Foo.DateTime), new KeyValuePair<string, object?>[] { new(nameof(AutoGenerateColumnAttribute.Text), LocalizerFoo[nameof(Foo.DateTime)].Value) });
5555
}
5656
else if (propertyName == nameof(Foo.Name))
5757
{
58-
context.AddRequiredAttribute(nameof(Foo.Name), Localizer["Name.Required"]);
58+
context.AddRequiredAttribute(nameof(Foo.Name), LocalizerFoo["Name.Required"]);
5959
// 使用 Text 设置显示名称示例
60-
col.Text = Localizer[nameof(Foo.Name)];
60+
col.Text = LocalizerFoo[nameof(Foo.Name)];
6161
}
6262
else if (propertyName == nameof(Foo.Count))
6363
{
6464
context.AddRequiredAttribute(nameof(Foo.Count));
6565
// 使用 DisplayNameAttribute 设置显示名称示例
66-
context.AddDisplayNameAttribute(nameof(Foo.Count), Localizer[nameof(Foo.Count)].Value);
66+
context.AddDisplayNameAttribute(nameof(Foo.Count), LocalizerFoo[nameof(Foo.Count)].Value);
6767
}
6868
else if (propertyName == nameof(Foo.Complete))
6969
{
7070
col.Filterable = true;
7171
// 使用 DisplayAttribute 设置显示名称示例
72-
context.AddDisplayAttribute(nameof(Foo.Complete), new KeyValuePair<string, object?>[] { new(nameof(DisplayAttribute.Name), Localizer[nameof(Foo.Complete)].Value) });
72+
context.AddDisplayAttribute(nameof(Foo.Complete), new KeyValuePair<string, object?>[] { new(nameof(DisplayAttribute.Name), LocalizerFoo[nameof(Foo.Complete)].Value) });
7373
}
7474
else if (propertyName == nameof(Foo.Id))
7575
{

0 commit comments

Comments
 (0)