Skip to content

Commit d4ec920

Browse files
committed
refactor: 更改方法名称
1 parent 1c9648f commit d4ec920

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

src/BootstrapBlazor/Components/ListView/ListView.razor

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,12 @@
7575
</div>
7676

7777
@code {
78-
RenderFragment RenderItem((object? GroupName, IOrderedEnumerable<TItem> Items) key, int index) =>
79-
@<CollapseItem Text="@GetGroupName(key.GroupName)" IsCollapsed="IsCollapsed(index, key.GroupName)">
80-
@foreach (var item in key.Items)
81-
{
82-
<div class="listview-item" @onclick="@(e => OnClick(item))">
83-
@if(BodyTemplate != null)
84-
{
85-
@BodyTemplate(item)
86-
}
87-
</div>
88-
}
89-
</CollapseItem>;
78+
79+
RenderFragment RenderGroupItem((object? GroupName, IOrderedEnumerable<TItem> Items) key, int index) =>
80+
@<CollapseItem Text="@GetGroupName(key.GroupName)" IsCollapsed="IsCollapsed(index, key.GroupName)">
81+
@foreach (var item in key.Items)
82+
{
83+
@RenderItem(item)
84+
}
85+
</CollapseItem>;
9086
}

src/BootstrapBlazor/Components/ListView/ListView.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ private RenderFragment RenderCollapsibleItems(Func<TItem, object?> groupFunc) =>
232232
foreach (var key in GetGroupItems(groupFunc))
233233
{
234234
var i = index++;
235-
builder.AddContent(i, RenderItem(key, i));
235+
builder.AddContent(i, RenderGroupItem(key, i));
236236
}
237237
};
238238

0 commit comments

Comments
 (0)