mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-02 12:07:44 +08:00
e892f343de
* add basic segmented * add more demos * add animation * change value first * fix duplicate selected * fix doc
32 lines
958 B
C#
32 lines
958 B
C#
@namespace AntDesign
|
|
@inherits AntDomComponentBase
|
|
@typeparam TValue
|
|
|
|
<div class="@ClassMapper.Class" style="@Style" @ref="@Ref" id="@Id">
|
|
<div class="ant-segmented-group">
|
|
@if (_sliding)
|
|
{
|
|
<div class="@_slidingCls" style="@_slidingStyle"></div>
|
|
}
|
|
<CascadingValue Value="this" IsFixed>
|
|
@if (ChildContent != null)
|
|
{
|
|
@ChildContent
|
|
}
|
|
else if (Options?.Any() == true)
|
|
{
|
|
@foreach (var option in Options)
|
|
{
|
|
<SegmentedItem TValue="TValue" Label="@option.Label" Value="@option.Value" @key="option.Value" Disabled="@(option.Disabled || Disabled)"></SegmentedItem>
|
|
}
|
|
}
|
|
else if (Labels?.Any() == true)
|
|
{
|
|
@foreach (var label in Labels)
|
|
{
|
|
<SegmentedItem TValue="TValue" Label="@label.ToString()" Value="@label" @key="label" Disabled="Disabled"></SegmentedItem>
|
|
}
|
|
}
|
|
</CascadingValue>
|
|
</div>
|
|
</div> |