Skip to content

Commit cac7b10

Browse files
committed
refactor: 代码统一
1 parent 9e3064f commit cac7b10

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

src/BootstrapBlazor/Components/AutoFill/AutoFill.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
@foreach (var item in FilterItems)
2222
{
2323
<li @key="@item" class="dropdown-item" @onclick="() => OnClickItem(item)">
24-
@if (Template != null)
24+
@if (ItemTemplate != null)
2525
{
26-
@Template(item)
26+
@ItemTemplate(item)
2727
}
2828
else
2929
{

src/BootstrapBlazor/Components/AutoFill/AutoFill.razor.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@ public partial class AutoFill<TValue>
4545
[Parameter]
4646
public bool ShowDropdownListOnFocus { get; set; } = true;
4747

48-
/// <summary>
49-
/// 获得/设置 候选项模板
50-
/// </summary>
51-
[Parameter]
52-
public RenderFragment<TValue>? Template { get; set; }
53-
5448
/// <summary>
5549
/// 获得/设置 通过模型获得显示文本方法 默认使用 ToString 重载方法
5650
/// </summary>

src/BootstrapBlazor/Components/Search/Search.razor

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
@foreach (var item in FilterItems)
2222
{
2323
<li class="dropdown-item">
24-
@if (ItemTemplate == null)
24+
@if (ItemTemplate != null)
2525
{
26-
<div>@item</div>
26+
@ItemTemplate(item)
2727
}
2828
else
2929
{
30-
@ItemTemplate(item)
30+
<div>@item</div>
3131
}
3232
</li>
3333
}

0 commit comments

Comments
 (0)