Skip to content

Commit c4213a2

Browse files
committed
refactor: 重构代码
1 parent 9f81048 commit c4213a2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/BootstrapBlazor/Components/Checkbox/CheckboxListGeneric.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ else
2929
<Checkbox TValue="bool" IsDisabled="GetDisabledState(item)"
3030
ShowAfterLabel="true" ShowLabel="false" ShowLabelTooltip="ShowLabelTooltip"
3131
DisplayText="@item.Text" OnBeforeStateChanged="_onBeforeStateChangedCallback!"
32-
Value="@item.Active" OnStateChanged="@((state, v) => OnStateChanged(item, v))"></Checkbox>
32+
Value="@item.Active" OnStateChanged="@((_, v) => OnStateChanged(item, v))"></Checkbox>
3333
</div>
3434
}
3535
</div>

src/BootstrapBlazor/Components/Checkbox/CheckboxListGeneric.razor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public partial class CheckboxListGeneric<TValue> : IModelEqualityComparer<TValue
2525
/// <summary>
2626
/// 获得 组件内部 Checkbox 项目样式
2727
/// </summary>
28-
protected string? CheckboxItemClassString => CssBuilder.Default("checkbox-item")
28+
private string? CheckboxItemClassString => CssBuilder.Default("checkbox-item")
2929
.AddClass(CheckboxItemClass)
3030
.Build();
3131

@@ -210,7 +210,7 @@ private async Task OnStateChanged(SelectedItem<TValue> item, bool v)
210210
items.AddRange(Value);
211211
}
212212

213-
var val = items.Find(i => IsEquals(item.Value));
213+
var val = items.Find(i => Equals(item.Value, i));
214214
if (v && val == null)
215215
{
216216
items.Add(item.Value);

0 commit comments

Comments
 (0)