ant-design-blazor/components/select/SelectOption.razor
XuRui 6a52961487 feat: add select component (#222)
* fix: other values may exist in FileAttributes

* feat: add javascript interop for select component

* feat: init select component

* docs: add menu item to select docs

* feat: implement dropdownRender for select component

* docs: init select docs

* fix: remove 3.0 iframe

Co-authored-by: ElderJames <shunjiey@hotmail.com>
2020-06-14 18:54:14 +08:00

35 lines
1.1 KiB
C#

@namespace AntDesign
@inherits AntDomComponentBase
<div style="@InnerStyle"
class="@ClassMapper.Class"
aria-selected="@IsSelected"
@onclick:preventDefault
@onclick:stopPropagation="true"
@onclick="OnSelectOptionClick"
@onmouseenter="OnSelectOptionMouseEnter"
@onmouseleave="OnSelectOptionMouseLeave">
<div class="@ClassPrefix-content" @ref="_contentRef">@ChildContent</div>
@switch (SelectParent.SelectMode)
{
case SelectMode.Default:
<span class="@ClassPrefix-state" unselectable="on" aria-hidden="true" style="user-select: none;"></span>
break;
default:
if (IsSelected)
{
<span unselectable="on" aria-hidden="true" style="user-select: none;" class="@ClassPrefix-state">
@if (SelectParent.MenuItemSelectedIcon != null)
{
@SelectParent.MenuItemSelectedIcon
}
else
{
<Icon Type="check"></Icon>
}
</span>
}
break;
}
</div>