Skip to content

Commit fdd97e3

Browse files
committed
refactor: 增加 DefaultVirtualizeItemText 参数
1 parent 3be46a4 commit fdd97e3

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/BootstrapBlazor/Components/Select/Select.razor.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ public partial class Select<TValue> : ISelect, ILookup
118118
[Parameter]
119119
public object? LookupServiceData { get; set; }
120120

121+
/// <summary>
122+
/// Gets or sets the default text for virtualized items. Default is null.
123+
/// </summary>
124+
[Parameter]
125+
public string? DefaultVirtualizeItemText { get; set; }
126+
121127
/// <summary>
122128
/// <inheritdoc/>
123129
/// </summary>
@@ -172,7 +178,7 @@ private SelectedItem? SelectedRow
172178
if (IsVirtualize)
173179
{
174180
_init = false;
175-
return new SelectedItem(CurrentValueAsString, CurrentValueAsString);
181+
return new SelectedItem(CurrentValueAsString, DefaultVirtualizeItemText ?? CurrentValueAsString);
176182
}
177183

178184
var item = GetItemWithEnumValue()

src/BootstrapBlazor/Components/Select/SelectBase.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,6 @@ public abstract class SelectBase<TValue> : PopoverSelectBase<TValue>
111111
[Parameter]
112112
public int OverscanCount { get; set; } = 4;
113113

114-
/// <summary>
115-
/// Gets or sets the default text for virtualized items. Default is null.
116-
/// </summary>
117-
[Parameter]
118-
[ExcludeFromCodeCoverage]
119-
[Obsolete("已弃用,删除即可;Deprecated, just delete")]
120-
public string? DefaultVirtualizeItemText { get; set; }
121-
122114
/// <summary>
123115
/// Gets or sets the callback method when the clear button is clicked. Default is null.
124116
/// </summary>

0 commit comments

Comments
 (0)