Skip to content

Commit 4d7b67f

Browse files
feat(SelectTree): add OnSearchAsync parameter (#7844)
* SelectTree有ShowSearch参数,漏掉OnSearchAsync参数 SelectTree有ShowSearch参数,漏掉OnSearchAsync参数 * refactor: 移除不用的命名空间 * chore: bump version 10.5.1-beta07 --------- Co-authored-by: Argo Zhang <argo@live.ca>
1 parent 2876e4c commit 4d7b67f

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/BootstrapBlazor/BootstrapBlazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>10.5.1-beta06</Version>
4+
<Version>10.5.1-beta07</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/Components/Select/SelectTree.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@namespace BootstrapBlazor.Components
1+
@namespace BootstrapBlazor.Components
22
@typeparam TValue
33
@inherits PopoverSelectBase<TValue>
44
@attribute [BootstrapModuleAutoLoader("Select/SelectTree.razor.js")]
@@ -22,7 +22,7 @@
2222
<div class="dropdown-menu">
2323
<TreeView TItem="TValue" Items="@Items" ShowIcon="ShowIcon" @ref="_tv"
2424
OnTreeItemClick="OnItemClick" ModelEqualityComparer="@ModelEqualityComparer"
25-
ShowSearch="ShowSearch" ShowResetSearchButton="ShowResetSearchButton"
25+
ShowSearch="ShowSearch" ShowResetSearchButton="ShowResetSearchButton" OnSearchAsync="OnSearchAsync"
2626
CanExpandWhenDisabled="CanExpandWhenDisabled"
2727
CustomKeyAttribute="@CustomKeyAttribute" OnExpandNodeAsync="@OnExpandNodeAsync" />
2828
</div>

src/BootstrapBlazor/Components/Select/SelectTree.razor.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@ public partial class SelectTree<TValue> : IModelEqualityComparer<TValue>
134134
[Parameter]
135135
public bool ShowSearch { get; set; }
136136

137+
/// <summary>
138+
/// <para lang="zh">获得/设置 搜索回调方法,默认为 null</para>
139+
/// <para lang="en">Gets or sets the search callback method. Default is null</para>
140+
/// </summary>
141+
/// <remarks>Enabled by setting <see cref="ShowSearch"/> to true.</remarks>
142+
[Parameter]
143+
public Func<string?, Task<List<TreeViewItem<TValue>>?>>? OnSearchAsync { get; set; }
144+
137145
/// <summary>
138146
/// <para lang="zh">获得/设置 是否固定搜索栏 默认 false 不固定</para>
139147
/// <para lang="en">Gets or sets Whether fixed search box. Default false</para>

0 commit comments

Comments
 (0)