Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/BootstrapBlazor.Server/Components/App.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<html lang="en" data-bs-theme='light'>

<head>
<meta name="theme-color" content="#712cf9">
<meta charset="utf-8" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="keywords" content="bootstrapblazor,bootstrap,blazor,wasm,webassembly,UI,netcore,web,assembly">
<meta name="description" content="基于 Bootstrap 风格的 Blazor UI 组件库,用于研发企业级中后台产品。">
<meta name="author" content="argo ([email protected])">
<meta name="theme-color" content="#712cf9">
<title>@Localizer["SiteTitle"]</title>
<base href="/" />
<link rel="icon" href="favicon.ico" type="image/x-icon">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ else
<Checkbox TValue="bool" IsDisabled="GetDisabledState(item)"
ShowAfterLabel="true" ShowLabel="false" ShowLabelTooltip="ShowLabelTooltip"
DisplayText="@item.Text" OnBeforeStateChanged="_onBeforeStateChangedCallback!"
Value="@item.Active" OnStateChanged="@((state, v) => OnStateChanged(item, v))"></Checkbox>
Value="@item.Active" OnStateChanged="@((_, v) => OnStateChanged(item, v))"></Checkbox>
</div>
}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class CheckboxListGeneric<TValue> : IModelEqualityComparer<TValue
/// <summary>
/// 获得 组件内部 Checkbox 项目样式
/// </summary>
protected string? CheckboxItemClassString => CssBuilder.Default("checkbox-item")
private string? CheckboxItemClassString => CssBuilder.Default("checkbox-item")
.AddClass(CheckboxItemClass)
.Build();

Expand Down Expand Up @@ -204,23 +204,23 @@ private async Task<bool> OnBeforeStateChanged(CheckboxState state)
private async Task OnStateChanged(SelectedItem<TValue> item, bool v)
{
item.Active = v;
var vals = new List<TValue?>();
var items = new List<TValue?>();
if (Value != null)
{
vals.AddRange(Value);
items.AddRange(Value);
}

var val = vals.Find(i => IsEquals(item.Value));
var val = items.Find(i => Equals(item.Value, i));
if (v && val == null)
{
vals.Add(item.Value);
items.Add(item.Value);
}
else
{
vals.Remove(val);
items.Remove(val);
}

CurrentValue = vals;
CurrentValue = items;

if (OnSelectedChanged != null)
{
Expand Down
Loading