Skip to content

Commit 3351523

Browse files
committed
doc: 更新搜索示例代码
1 parent 8981f09 commit 3351523

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,10 @@ private Task SelectedItemOnChanged(SelectedItem selectedItem)
228228

229229
private Task OnSearchAsync(string searchText)
230230
{
231-
SearchItems = string.IsNullOrEmpty(searchText) ? TreeFoo.GetTreeItems() : [];
231+
SearchItems =
232+
[
233+
new TreeViewItem<TreeFoo>(new TreeFoo() { Text = searchText }) { Text = searchText },
234+
];
232235
StateHasChanged();
233236
return Task.CompletedTask;
234237
}

0 commit comments

Comments
 (0)