Skip to content

Commit 5c629bb

Browse files
authored
feat(ListView): item template support click callback (#4370)
* feat: 模板支持 OnClick 与内置样式 * chore: bump version 8.9.4
1 parent ed8209e commit 5c629bb

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/BootstrapBlazor/BootstrapBlazor.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

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

77
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">

src/BootstrapBlazor/Components/ListGroup/ListGroup.razor

+10-8
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@
1414
<div class="list-group-body scroll">
1515
@foreach (var item in Items)
1616
{
17-
@if (ItemTemplate != null)
18-
{
19-
@ItemTemplate(item)
20-
}
21-
else
22-
{
23-
<div @key="item" class="@GetItemClassString(item)" @onclick="() => OnClick(item)">@GetItemText(item)</div>
24-
}
17+
<div @key="item" class="@GetItemClassString(item)" @onclick="() => OnClick(item)">
18+
@if (ItemTemplate != null)
19+
{
20+
@ItemTemplate(item)
21+
}
22+
else
23+
{
24+
@GetItemText(item)
25+
}
26+
</div>
2527
}
2628
</div>
2729
</div>

0 commit comments

Comments
 (0)