@@ -39,13 +39,13 @@ public partial class BootstrapInputNumber<TValue>
3939 /// 获得/设置 数值增加时回调委托
4040 /// </summary>
4141 [ Parameter ]
42- public Func < TValue , Task > ? OnIncrement { get ; set ; }
42+ public Func < TValue ? , Task > ? OnIncrement { get ; set ; }
4343
4444 /// <summary>
4545 /// 获得/设置 数值减少时回调委托
4646 /// </summary>
4747 [ Parameter ]
48- public Func < TValue , Task > ? OnDecrement { get ; set ; }
48+ public Func < TValue ? , Task > ? OnDecrement { get ; set ; }
4949
5050 /// <summary>
5151 /// 获得/设置 最小值
@@ -161,9 +161,9 @@ protected override void OnAfterRender(bool firstRender)
161161 /// </summary>
162162 /// <param name="value">The value to format.</param>
163163 /// <returns>A string representation of the value.</returns>
164- protected override string ? FormatValueAsString ( TValue value ) => UseInputEvent ? _lastInputValueString : GetFormatString ( value ) ;
164+ protected override string ? FormatValueAsString ( TValue ? value ) => UseInputEvent ? _lastInputValueString : GetFormatString ( value ) ;
165165
166- private string ? GetFormatString ( TValue value ) => Formatter != null
166+ private string ? GetFormatString ( TValue ? value ) => Formatter != null
167167 ? Formatter . Invoke ( value )
168168 : ( ! string . IsNullOrEmpty ( FormatString ) && value != null
169169 ? Utility . Format ( value , FormatString )
@@ -175,7 +175,7 @@ protected override void OnAfterRender(bool firstRender)
175175 /// <param name="value"></param>
176176 /// <returns></returns>
177177 /// <exception cref="InvalidOperationException"></exception>
178- protected virtual string ? InternalFormat ( TValue value ) => value switch
178+ protected virtual string ? InternalFormat ( TValue ? value ) => value switch
179179 {
180180 null => null ,
181181 int @int => BindConverter . FormatValue ( @int , CultureInfo . InvariantCulture ) ,
@@ -288,7 +288,7 @@ protected override async Task OnBlur()
288288 }
289289 }
290290
291- private TValue SetMin ( TValue val )
291+ private TValue ? SetMin ( TValue ? val )
292292 {
293293 if ( ! string . IsNullOrEmpty ( Min ) )
294294 {
@@ -317,7 +317,7 @@ private TValue SetMin(TValue val)
317317 return val ;
318318 }
319319
320- private TValue SetMax ( TValue val )
320+ private TValue ? SetMax ( TValue ? val )
321321 {
322322 if ( ! string . IsNullOrEmpty ( Max ) )
323323 {
0 commit comments