Skip to content

Commit a2d67ee

Browse files
committed
Revert "wip: 临时提交"
This reverts commit 63d5bee. # Conflicts: # src/BootstrapBlazor/Components/AutoComplete/AutoComplete.razor.cs
1 parent 55ddf56 commit a2d67ee

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/BootstrapBlazor/Components/AutoFill/AutoFill.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<span class="form-select-append"><i class="@Icon"></i></span>
1919
<span class="form-select-append ac-loading"><i class="@LoadingIcon"></i></span>
2020
<ul class="dropdown-menu">
21-
@foreach (var item in _filterItems)
21+
@foreach (var item in Rows)
2222
{
2323
<li @key="@item" class="dropdown-item" @onclick="() => OnClickItem(item)">
2424
@if (ItemTemplate != null)
@@ -31,7 +31,7 @@
3131
}
3232
</li>
3333
}
34-
@if (ShowNoDataTip && _filterItems.Count == 0)
34+
@if (ShowNoDataTip && Rows.Count == 0)
3535
{
3636
<li class="dropdown-item">@NoDataTip</li>
3737
}

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ public partial class AutoFill<TValue>
1919
.AddClassFromAttributes(AdditionalAttributes)
2020
.Build();
2121

22+
private List<TValue>? _filterItems;
23+
2224
/// <summary>
2325
/// 获得/设置 组件数据集合
2426
/// </summary>
@@ -101,10 +103,7 @@ public partial class AutoFill<TValue>
101103

102104
private string? _displayText;
103105

104-
/// <summary>
105-
/// 获得 最终搜索数据源
106-
/// </summary>
107-
private List<TValue>? _filterItems = null;
106+
private List<TValue> Rows => _filterItems ?? Items.ToList();
108107

109108
/// <summary>
110109
/// <inheritdoc/>
@@ -122,7 +121,6 @@ protected override void OnParametersSet()
122121
_displayText = Value is null ? "" : OnGetDisplayText(Value);
123122

124123
Items ??= [];
125-
_filterItems ??= [];
126124
}
127125

128126
/// <summary>

0 commit comments

Comments
 (0)