Browse Source
Merge pull request #18783 from abpframework/liangshiwei/customMenu
Check if the type is a component before rendering
pull/18805/head
Enis Necipoglu
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
10 additions and
10 deletions
-
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/FirstLevelNavMenuItem.razor
-
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Web.BasicTheme/Themes/Basic/SecondLevelNavMenuItem.razor
-
modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/Default.cshtml
-
modules/basic-theme/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Themes/Basic/Components/Menu/_MenuItem.cshtml
|
|
|
@ -8,7 +8,7 @@ |
|
|
|
} |
|
|
|
@if (MenuItem.IsLeaf) |
|
|
|
{ |
|
|
|
if (customComponentType != null) |
|
|
|
if (customComponentType != null && typeof(ComponentBase).IsAssignableFrom(customComponentType)) |
|
|
|
{ |
|
|
|
<DynamicComponent Type="@customComponentType" /> |
|
|
|
} |
|
|
|
@ -32,7 +32,7 @@ else |
|
|
|
{ |
|
|
|
<li class="nav-item"> |
|
|
|
<div class="dropdown"> |
|
|
|
@if (customComponentType != null) |
|
|
|
@if (customComponentType != null && typeof(ComponentBase).IsAssignableFrom(customComponentType)) |
|
|
|
{ |
|
|
|
<DynamicComponent Type="@customComponentType" /> |
|
|
|
} |
|
|
|
|
|
|
|
@ -8,7 +8,7 @@ |
|
|
|
} |
|
|
|
@if (MenuItem.IsLeaf) |
|
|
|
{ |
|
|
|
if (customComponentType != null) |
|
|
|
if (customComponentType != null && typeof(ComponentBase).IsAssignableFrom(customComponentType)) |
|
|
|
{ |
|
|
|
<DynamicComponent Type="@customComponentType" /> |
|
|
|
} |
|
|
|
@ -28,7 +28,7 @@ |
|
|
|
else |
|
|
|
{ |
|
|
|
<div class="dropdown-submenu"> |
|
|
|
@if (customComponentType != null) |
|
|
|
@if (customComponentType != null && typeof(ComponentBase).IsAssignableFrom(customComponentType)) |
|
|
|
{ |
|
|
|
<DynamicComponent Type="@customComponentType" /> |
|
|
|
} |
|
|
|
|
|
|
|
@ -10,7 +10,7 @@ |
|
|
|
|
|
|
|
if (menuItem.IsLeaf) |
|
|
|
{ |
|
|
|
if (customComponentType != null) |
|
|
|
if (customComponentType != null && typeof(ViewComponent).IsAssignableFrom(customComponentType)) |
|
|
|
{ |
|
|
|
@(await Component.InvokeAsync(customComponentType)) |
|
|
|
} |
|
|
|
@ -34,7 +34,7 @@ |
|
|
|
{ |
|
|
|
<li class="nav-item"> |
|
|
|
<div class="dropdown"> |
|
|
|
@if (customComponentType != null) |
|
|
|
@if (customComponentType != null && typeof(ViewComponent).IsAssignableFrom(customComponentType)) |
|
|
|
{ |
|
|
|
@(await Component.InvokeAsync(customComponentType)) |
|
|
|
} |
|
|
|
|
|
|
|
@ -10,7 +10,7 @@ |
|
|
|
} |
|
|
|
@if (Model.IsLeaf) |
|
|
|
{ |
|
|
|
if (customComponentType != null) |
|
|
|
if (customComponentType != null && typeof(ViewComponent).IsAssignableFrom(customComponentType)) |
|
|
|
{ |
|
|
|
@(await Component.InvokeAsync(customComponentType)) |
|
|
|
} |
|
|
|
@ -31,10 +31,10 @@ |
|
|
|
else |
|
|
|
{ |
|
|
|
<div class="dropdown-submenu"> |
|
|
|
@if (customComponentType != null) |
|
|
|
{ |
|
|
|
@if (customComponentType != null && typeof(ViewComponent).IsAssignableFrom(customComponentType)) |
|
|
|
{ |
|
|
|
@(await Component.InvokeAsync(customComponentType)) |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
<a role="button" class="btn dropdown-toggle" data-bs-toggle="dropdown" |
|
|
|
|