ant-design-blazor/components/select/SelectOption.razor
liuhai 5fd4aa9a7d fix(module: select): two-way binding #305 (#320)
* feat: add auto-complete component

* Select 组件
1. 组件支持双向绑定
2. 优化效率
3. 修复多选模式点击时下拉面板折叠问题

Co-authored-by: ElderJames <shunjiey@hotmail.com>
2020-07-29 12:44:16 +08:00

33 lines
1.1 KiB
C#

@namespace AntDesign
@inherits AntDomComponentBase
<div style="@InnerStyle"
class="@ClassMapper.Class"
aria-selected="@IsSelected"
@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>