mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-14 00:41:30 +08:00
45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
@namespace AntDesign
|
|
@inherits AntDomComponentBase
|
|
|
|
<CascadingValue Value="this" IsFixed>
|
|
<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 (IconTemplate != null)
|
|
{
|
|
@IconTemplate
|
|
}
|
|
else 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)
|
|
{
|
|
@item.Title
|
|
}
|
|
else
|
|
{
|
|
@item.ChildContent
|
|
}
|
|
</span>
|
|
</Template>;
|
|
}
|