mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-05 05:27:37 +08:00
1f76b2afc5
* fix(module: checkbox): default value binding * fix: default value for select-group
37 lines
1.3 KiB
C#
37 lines
1.3 KiB
C#
@namespace AntDesign
|
|
@inherits AntInputComponentBase<string[]>
|
|
|
|
<CascadingValue Value="this">
|
|
<div class="@ClassMapper.Class" style="@Style" id="@Id" @ref="Ref">
|
|
@if (Options.Value != null)
|
|
{
|
|
if (Options.IsT0)
|
|
{
|
|
@foreach (var option in Options.AsT0)
|
|
{
|
|
<Checkbox class="ant-checkbox-group-item"
|
|
Disabled="option.Disabled || Disabled"
|
|
Checked="@(option.Checked)"
|
|
Label="@option.Value"
|
|
CheckedChange="_=>OnCheckedChange()">
|
|
<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"
|
|
CheckedChange="_=>OnCheckedChange()">
|
|
<span>@option</span>
|
|
</Checkbox>
|
|
}
|
|
}
|
|
}
|
|
@ChildContent
|
|
</div>
|
|
</CascadingValue> |