Skip to content

Commit cd53d38

Browse files
committed
doc: 更新示例代码
1 parent 2ad53ef commit cd53d38

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,20 @@
184184

185185
<DemoBlock Title="@Localizer["TreeViewVirtualizeTitle"]"
186186
Introduction="@Localizer["TreeViewVirtualizeIntro"]"
187-
Name="DefaultExpand">
188-
<section ignore>
189-
@((MarkupString)Localizer["TreeViewVirtualizeDescription"].Value)
187+
Name="IsVirtualize">
188+
<section ignore class="row g-3">
189+
<div class="col-12">
190+
@((MarkupString)Localizer["TreeViewVirtualizeDescription"].Value)
191+
</div>
192+
<div class="col-12">
193+
<BootstrapInputGroup>
194+
<BootstrapInputGroupLabel DisplayText="ShowSearch"></BootstrapInputGroupLabel>
195+
<Switch @bind-Value="_showSearch"></Switch>
196+
</BootstrapInputGroup>
197+
</div>
190198
</section>
191199
<div style="height: 400px">
192-
<TreeView Items="@VirtualizeItems" ShowCheckbox="true" IsVirtualize="true"
200+
<TreeView Items="@VirtualizeItems" ShowCheckbox="true" ShowSearch="_showSearch" IsVirtualize="true"
193201
AutoCheckChildren="true" AutoCheckParent="true"
194202
OnExpandNodeAsync="OnExpandVirtualNodeAsync"></TreeView>
195203
</div>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ public sealed partial class TreeViews
7474

7575
private Foo Model => Foo.Generate(LocalizerFoo);
7676

77+
private bool _showSearch;
78+
7779
private string? _selectedValue;
7880

7981
private Task OnTreeItemClick(TreeViewItem<TreeFoo> item)

0 commit comments

Comments
 (0)