Skip to content

Commit 2c5f7e4

Browse files
authored
refactor(TreeView): remove IsFixedSearch parameter (#5658)
* refactor: 移除 IsFixedSearch 参数 * test: 更新单元测试
1 parent 7921a8a commit 2c5f7e4

File tree

3 files changed

+0
-19
lines changed

3 files changed

+0
-19
lines changed

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone
55

6-
using Microsoft.AspNetCore.Components.Rendering;
7-
using Microsoft.AspNetCore.Components.Web;
8-
96
namespace BootstrapBlazor.Server.Components.Samples;
107

118
/// <summary>

src/BootstrapBlazor/Components/TreeView/TreeView.razor.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone
55

6-
using Microsoft.AspNetCore.Components.Web;
76
using Microsoft.Extensions.Localization;
87

98
namespace BootstrapBlazor.Components;
@@ -15,7 +14,6 @@ namespace BootstrapBlazor.Components;
1514
public partial class TreeView<TItem> : IModelEqualityComparer<TItem>
1615
{
1716
private string? ClassString => CssBuilder.Default("tree-view")
18-
.AddClass("is-fixed-search", ShowSearch && IsFixedSearch)
1917
.AddClassFromAttributes(AdditionalAttributes)
2018
.Build();
2119

@@ -86,12 +84,6 @@ public partial class TreeView<TItem> : IModelEqualityComparer<TItem>
8684
[Parameter]
8785
public bool ShowSearch { get; set; }
8886

89-
/// <summary>
90-
/// Gets or sets whether the search bar is fixed. Default is false.
91-
/// </summary>
92-
[Parameter]
93-
public bool IsFixedSearch { get; set; }
94-
9587
/// <summary>
9688
/// Gets or sets whether to show the reset search button. Default is true.
9789
/// </summary>

test/UnitTest/Components/TreeViewTest.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone
55

6-
using System.Threading.Tasks;
7-
86
namespace UnitTest.Components;
97

108
public class TreeViewTest : BootstrapBlazorTestBase
@@ -1051,12 +1049,6 @@ public void ShowSearch_Ok()
10511049
});
10521050
});
10531051
cut.Contains("search-template");
1054-
1055-
cut.SetParametersAndRender(pb =>
1056-
{
1057-
pb.Add(a => a.IsFixedSearch, true);
1058-
});
1059-
cut.Contains("is-fixed-search");
10601052
}
10611053

10621054
[Fact]

0 commit comments

Comments
 (0)