feat(module:menu): Add PopupClassName Property For SubMenu (#3027)

Co-authored-by: JustGentle <justgentle@sina.com>
This commit is contained in:
James Yeung 2023-01-19 18:12:25 +08:00 committed by GitHub
parent 789d315ad7
commit bec3f840d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -47,6 +47,7 @@ else if (RootMenu.InlineCollapsed || RootMenu.InternalMode == MenuMode.Horizonta
OnVisibleChange="OnOverlayVisibleChange"
OnOverlayHiding="OnOverlayHiding"
Trigger="new Trigger[] { RootMenu?.TriggerSubMenuAction ?? AntDesign.Trigger.Hover }"
OverlayClassName="@PopupClassName"
PlacementCls="@($"{prefixCls}-popup {RootMenu.PrefixCls} {RootMenu.PrefixCls}-{RootMenu.Theme} {prefixCls}-placement-{_placement.Name}")">
<ChildContent>
<div class="@(prefixCls)-title" role="button">
@ -78,7 +79,7 @@ else if (RootMenu.InlineCollapsed || RootMenu.InternalMode == MenuMode.Horizonta
@code
{
private RenderFragment GetArrow()
{
{
string prefixCls = $"{RootMenu.PrefixCls}-submenu";
if (RootMenu.PrefixCls.Contains("dropdown"))
{
@ -92,8 +93,8 @@ else if (RootMenu.InlineCollapsed || RootMenu.InternalMode == MenuMode.Horizonta
}
else if (Parent is AntDesign.SubMenu || RootMenu.Mode == MenuMode.Vertical)
{
return @<i class="@(prefixCls)-arrow"></i>;
}
return @<i class="@(prefixCls)-arrow"></i>;
}
return default;
}
}

View File

@ -32,6 +32,9 @@ namespace AntDesign
}
}
[Parameter]
public string PopupClassName { get; set; }
[Parameter]
public string Title { get; set; }