ant-design-blazor/components/select/internal/SelectOptionGroup.razor
ElDiddi 41077bc2fb refactor(module: select): completely new (#800)
* select-rewritten

select-rewritten

* modul: select - update 1

* select-update2

* select-update3

* select-update 4

* feat: append label tag & auto tokenization

* fix: conflict in drpdown demo

Co-authored-by: Lars Diederich <diederich@evodata.de>
Co-authored-by: ElderJames <shunjiey@hotmail.com>
2020-11-27 13:13:26 +08:00

32 lines
938 B
C#

@namespace AntDesign.Select.Internal
@inherits AntDomComponentBase
@typeparam TItemValue
@typeparam TItem
@{
RenderFragment<SelectOptionItem<TItemValue, TItem>> selectOptionFragment = (model) =>
@<SelectOption
@key="@model.InternalId"
TItemValue="TItemValue"
TItem="TItem">
</SelectOption>;
}
@foreach (var selectOption in SelectParent.SortedSelectOptionItems)
{
if (_oldGroupName == selectOption.GroupName)
{
<CascadingValue Value="@selectOption.InternalId" Name="InternalId">
@selectOptionFragment(selectOption)
</CascadingValue>
}
else
{
<div class="@ClassMapper.Class">@selectOption.GroupName</div>
<CascadingValue Value="@selectOption.InternalId" Name="InternalId">
@selectOptionFragment(selectOption)
</CascadingValue>
_oldGroupName = selectOption.GroupName;
}
}