Skip to content

Commit 3e9f309

Browse files
committed
refactor: 使用 razor 文件
1 parent 3939e7e commit 3e9f309

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@namespace BootstrapBlazor.Components
2+
@inherits BootstrapComponentBase
3+
4+
<CascadingValue Value="@_filter.Filters" IsFixed="true">
5+
@ChildContent
6+
</CascadingValue>

src/BootstrapBlazor/Components/QueryBuilder/QueryGroup.cs renamed to src/BootstrapBlazor/Components/QueryBuilder/QueryGroup.razor.cs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
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-
86
namespace BootstrapBlazor.Components;
97

108
/// <summary>
119
/// QueryGroup 组件
1210
/// </summary>
13-
public class QueryGroup : BootstrapComponentBase, IDisposable
11+
public partial class QueryGroup : IDisposable
1412
{
1513
/// <summary>
1614
/// 获得/设置 子组件
@@ -55,19 +53,6 @@ protected override void OnParametersSet()
5553
_filter.FilterLogic = Logic;
5654
}
5755

58-
/// <summary>
59-
/// <inheritdoc/>
60-
/// </summary>
61-
/// <param name="builder"></param>
62-
protected override void BuildRenderTree(RenderTreeBuilder builder)
63-
{
64-
builder.OpenComponent<CascadingValue<List<FilterKeyValueAction>>>(10);
65-
builder.AddAttribute(20, nameof(CascadingValue<List<FilterKeyValueAction>>.IsFixed), true);
66-
builder.AddAttribute(30, nameof(CascadingValue<List<FilterKeyValueAction>>.Value), _filter.Filters);
67-
builder.AddAttribute(40, nameof(CascadingValue<List<FilterKeyValueAction>>.ChildContent), ChildContent);
68-
builder.CloseComponent();
69-
}
70-
7156
/// <summary>
7257
/// 释放资源
7358
/// </summary>

0 commit comments

Comments
 (0)