File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
src/BootstrapBlazor/Components/AutoComplete Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 1717 <span class =" form-select-append" ><i class =" @Icon" ></i ></span >
1818 <span class =" form-select-append ac-loading" ><i class =" @LoadingIcon" ></i ></span >
1919 <ul class =" dropdown-menu" >
20- @foreach ( var item in _filterItems )
20+ @foreach ( var item in Rows )
2121 {
2222 <li @key =" item" class =" dropdown-item" @onclick =" () => OnClickItem(item)" >
2323 @if (ItemTemplate == null )
3030 }
3131 </li >
3232 }
33- @if (ShowNoDataTip && _filterItems .Count == 0 )
33+ @if (ShowNoDataTip && Rows .Count == 0 )
3434 {
3535 <li class =" dropdown-item" >@NoDataTip </li >
3636 }
Original file line number Diff line number Diff line change @@ -87,9 +87,6 @@ public partial class AutoComplete
8787 /// </summary>
8888 private string ? ShowDropdownListOnFocusString => ShowDropdownListOnFocus ? "true" : null ;
8989
90- /// <summary>
91- /// 获得/设置 UI 呈现数据集合
92- /// </summary>
9390 private List < string > ? _filterItems ;
9491
9592 /// <summary>
@@ -109,12 +106,12 @@ protected override void OnParametersSet()
109106 {
110107 base . OnParametersSet ( ) ;
111108
112- Icon ??= IconTheme . GetIconByKey ( ComponentIcons . AutoCompleteIcon ) ;
113- LoadingIcon ??= IconTheme . GetIconByKey ( ComponentIcons . LoadingIcon ) ;
114109 NoDataTip ??= Localizer [ nameof ( NoDataTip ) ] ;
115110 PlaceHolder ??= Localizer [ nameof ( PlaceHolder ) ] ;
111+ Icon ??= IconTheme . GetIconByKey ( ComponentIcons . AutoCompleteIcon ) ;
112+ LoadingIcon ??= IconTheme . GetIconByKey ( ComponentIcons . LoadingIcon ) ;
116113
117- _filterItems ??= Items ? . ToList ( ) ?? [ ] ;
114+ Items ??= [ ] ;
118115 }
119116
120117 /// <summary>
@@ -129,6 +126,8 @@ private async Task OnClickItem(string val)
129126 }
130127 }
131128
129+ private List < string > Rows => _filterItems ?? Items . ToList ( ) ;
130+
132131 /// <summary>
133132 /// TriggerFilter 方法
134133 /// </summary>
You can’t perform that action at this time.
0 commit comments