ant-design-blazor/components/checkbox/CheckboxGroup.razor

35 lines
1.2 KiB
C#
Raw Normal View History

@namespace AntDesign
@inherits AntInputComponentBase<string[]>
2020-01-11 01:10:05 +08:00
<CascadingValue Value="this">
<div class="@ClassMapper.Class" style="@Style" id="@Id" @ref="Ref">
@if (Options.Value != null)
{
if (Options.IsT0)
2020-04-24 18:32:50 +08:00
{
@foreach (var option in Options.AsT0)
{
<Checkbox class="ant-checkbox-group-item"
Disabled="option.Disabled || Disabled"
Checked="@option.Checked"
Label="@option.Value">
<span>@option.Label</span>
</Checkbox>
}
}
else
{
@foreach (var option in Options.AsT1)
{
<Checkbox class="ant-checkbox-group-item"
Disabled="Disabled"
Checked="@option.IsIn(_selectedValues)"
Label="@option">
<span>@option</span>
</Checkbox>
}
2020-04-24 18:32:50 +08:00
}
}
@ChildContent
</div>
</CascadingValue>