2020-05-29 00:33:49 +08:00
|
|
|
|
@namespace AntDesign
|
2020-04-23 17:13:56 +08:00
|
|
|
|
@inherits AntDomComponentBase
|
2019-12-09 00:25:22 +08:00
|
|
|
|
|
2021-01-22 10:15:24 +08:00
|
|
|
|
<CascadingValue Value="this" IsFixed>
|
2021-02-04 16:21:56 +08:00
|
|
|
|
<Tooltip Title="@content(this)" Placement="@PlacementType.Right" Disabled="TooltipDisabled">
|
|
|
|
|
<Unbound>
|
|
|
|
|
<li class="@ClassMapper.Class" role="menuitem" style=" @(PaddingLeft>0? $"padding-left:{PaddingLeft}px;":"") @Style" @onclick="HandleOnClick" @key="Key" @ref="context.Current">
|
|
|
|
|
@if (Icon != null)
|
|
|
|
|
{
|
|
|
|
|
<Icon Type="@Icon" />
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@if (RouterLink == null)
|
|
|
|
|
{
|
|
|
|
|
@content(this)
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<MenuLink Href="@RouterLink" Match="@RouterMatch">@content(this)</MenuLink>
|
|
|
|
|
}
|
|
|
|
|
</li>
|
|
|
|
|
</Unbound>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</CascadingValue>
|
|
|
|
|
|
|
|
|
|
@code {
|
|
|
|
|
RenderFragment<MenuItem> content = item =>@<Template>
|
|
|
|
|
<span>
|
|
|
|
|
@if (item.Title != null)
|
2020-11-16 12:57:42 +08:00
|
|
|
|
{
|
2021-02-04 16:21:56 +08:00
|
|
|
|
@item.Title
|
2020-11-16 12:57:42 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2021-02-04 16:21:56 +08:00
|
|
|
|
@item.ChildContent
|
|
|
|
|
}
|
|
|
|
|
</span>
|
|
|
|
|
</Template>;
|
|
|
|
|
}
|