Skip to content

Commit 39f3064

Browse files
committed
refactor: 更新值
1 parent 7c72861 commit 39f3064

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/BootstrapBlazor.Server/Components/Samples/SelectCities.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<div class="col-12 col-sm-6">
2727
<BootstrapInputGroup>
2828
<BootstrapInputGroupLabel DisplayText="IsMultiple"></BootstrapInputGroupLabel>
29-
<Switch @bind-Value="@_isMultiple"></Switch>
29+
<Switch Value="@_isMultiple" OnValueChanged="OnValueChagned"></Switch>
3030
</BootstrapInputGroup>
3131
</div>
3232
<div class="col-12 col-sm-6">

src/BootstrapBlazor.Server/Components/Samples/SelectCities.razor.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,12 @@ public partial class SelectCities
1919
private bool _isDisabled = false;
2020

2121
private bool _autoClose = true;
22+
23+
private Task OnValueChagned(bool v)
24+
{
25+
_value = "";
26+
_isMultiple = v;
27+
StateHasChanged();
28+
return Task.CompletedTask;
29+
}
2230
}

0 commit comments

Comments
 (0)