ant-design-blazor/components/rate/Rate.razor
大风 96fc45f4ae feat: add Rate (#166)
* feat: add Rate

* fix: fix two-way binding

Co-authored-by: James Yeung <shunjiey@hotmail.com>
2020-05-31 22:26:33 +08:00

24 lines
1.0 KiB
C#

@namespace AntDesign
@inherits AntDesign.AntDomComponentBase
@using Microsoft.AspNetCore.Components;
<ul class="@ClassMapper.Class" tabindex="0" role="radiogroup" style="@Style" @ref="Ref" id="@Id"
@onblur="@Blur"
@onfocus="@Focus"
@onkeydown="@KeyDown" @onkeydown:preventDefault
@onmouseout="@MouseLeave" @onmouseout:stopPropagation>
@foreach (RateMetaData item in RateMetaDatas)
{
<CascadingValue Value="@Character" Name="Character">
<RateItem AllowHalf="@AllowHalf"
IndexOfGroup="@item.SerialNumber"
Tooltip="@item.ToolTipText"
HoverValue="@_hoverValue"
HasHalf="@_hasHalf"
IsFocused="@_isFocused"
OnItemClick="@(itemIsHalf=>ItemClick(item.SerialNumber,itemIsHalf))"
OnItemHover="@(itemIshalf=>ItemHoverChange(item.SerialNumber,itemIshalf))" />
</CascadingValue>
}
</ul>