File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/BootstrapBlazor/Components/AutoComplete Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ private async Task OnClickItem(string val)
126126 }
127127 }
128128
129- private List < string > Rows => _filterItems ?? Items . ToList ( ) ;
129+ private List < string > Rows => _filterItems ?? [ .. Items ] ;
130130
131131 /// <summary>
132132 /// TriggerFilter 方法
@@ -138,24 +138,24 @@ public override async Task TriggerFilter(string val)
138138 if ( OnCustomFilter != null )
139139 {
140140 var items = await OnCustomFilter ( val ) ;
141- _filterItems = items . ToList ( ) ;
141+ _filterItems = [ .. items ] ;
142142 }
143143 else if ( string . IsNullOrEmpty ( val ) )
144144 {
145- _filterItems = Items . ToList ( ) ;
145+ _filterItems = [ .. Items ] ;
146146 }
147147 else
148148 {
149149 var comparison = IgnoreCase ? StringComparison . OrdinalIgnoreCase : StringComparison . Ordinal ;
150150 var items = IsLikeMatch
151151 ? Items . Where ( s => s . Contains ( val , comparison ) )
152152 : Items . Where ( s => s . StartsWith ( val , comparison ) ) ;
153- _filterItems = items . ToList ( ) ;
153+ _filterItems = [ .. items ] ;
154154 }
155155
156156 if ( DisplayCount != null )
157157 {
158- _filterItems = _filterItems . Take ( DisplayCount . Value ) . ToList ( ) ;
158+ _filterItems = [ .. _filterItems . Take ( DisplayCount . Value ) ] ;
159159 }
160160 StateHasChanged ( ) ;
161161 }
You can’t perform that action at this time.
0 commit comments