File tree Expand file tree Collapse file tree 3 files changed +4
-11
lines changed
src/BootstrapBlazor/Components/Button Expand file tree Collapse file tree 3 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
4040 }
4141
4242 /// <summary>
43- /// OnClickButton 方法
43+ /// OnClickButton 方法
4444 /// </summary>
4545 protected virtual async Task OnClickButton ( )
4646 {
@@ -50,14 +50,7 @@ protected virtual async Task OnClickButton()
5050 IsDisabled = true ;
5151 }
5252
53- if ( IsAsync )
54- {
55- await Task . Run ( ( ) => InvokeAsync ( HandlerClick ) ) ;
56- }
57- else
58- {
59- await HandlerClick ( ) ;
60- }
53+ await HandlerClick ( ) ;
6154
6255 // 恢复按钮
6356 if ( IsAsync && ButtonType == ButtonType . Button )
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ protected override async Task OnClickButton()
3636 IsAsyncLoading = true ;
3737 IsDisabled = true ;
3838
39- await Task . Run ( ( ) => InvokeAsync ( HandlerClick ) ) ;
39+ await HandlerClick ( ) ;
4040 await UpdateCount ( ) ;
4141
4242 IsDisabled = false ;
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ private async Task OnClickConfirm()
9797 IsDisabled = true ;
9898 IsAsyncLoading = true ;
9999 StateHasChanged ( ) ;
100- await Task . Run ( ( ) => InvokeAsync ( OnConfirm ) ) ;
100+ await OnConfirm ( ) ;
101101
102102 if ( ButtonType == ButtonType . Submit )
103103 {
You can’t perform that action at this time.
0 commit comments