Skip to content

Commit 4d6fd47

Browse files
committed
refactor: 更改 ShowSwal 默认值
1 parent 4d02037 commit 4d6fd47

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ public partial class Select<TValue> : ISelect, ILookup
5959
public Func<SelectedItem, Task<bool>>? OnBeforeSelectedItemChange { get; set; }
6060

6161
/// <summary>
62-
/// Gets or sets whether to show the Swal confirmation popup when <see cref="OnBeforeSelectedItemChange"/> returns true. Default is true.
63-
/// 获得/设置 是否显示 Swal 确认弹窗 默认值 为 true
62+
/// Gets or sets whether to show the Swal confirmation popup. Default is false.
63+
/// 获得/设置 是否显示 Swal 确认弹窗 默认值 为 false
6464
/// </summary>
6565
[Parameter]
66-
public bool ShowSwal { get; set; } = true;
66+
public bool ShowSwal { get; set; }
6767

6868
/// <summary>
6969
/// Gets or sets the callback method when the selected item changes.
@@ -348,13 +348,11 @@ private async Task OnClickItem(SelectedItem item)
348348
if (OnBeforeSelectedItemChange != null)
349349
{
350350
ret = await OnBeforeSelectedItemChange(item);
351-
return;
352351
}
353352

354353
// 如果 ShowSwal 为 true 且 则显示 Swal 确认弹窗,通过确认弹窗返回值决定是否修改选中项
355-
if (ShowSwal)
354+
if (ret && ShowSwal)
356355
{
357-
// Return true to show modal
358356
var option = new SwalOption()
359357
{
360358
Category = SwalCategory,

0 commit comments

Comments
 (0)