mirror of https://github.com/abpframework/abp.git
6 changed files with 32 additions and 75 deletions
@ -1,5 +0,0 @@ |
|||
@using Volo.Abp.Ui.Branding |
|||
@using MudBlazor |
|||
@inject IBrandingProvider BrandingProvider |
|||
|
|||
<MudText Typo="Typo.h6" Class="ma-0">@BrandingProvider.AppName</MudText> |
|||
@ -1,56 +0,0 @@ |
|||
@using Volo.Abp.UI.Navigation |
|||
@using MudBlazor |
|||
@using Microsoft.AspNetCore.Components |
|||
@using Microsoft.AspNetCore.Components.Routing |
|||
@using System |
|||
@{ |
|||
var customComponentType = MenuItem.GetComponentTypeOrDefault(); |
|||
} |
|||
|
|||
@if (customComponentType != null && typeof(ComponentBase).IsAssignableFrom(customComponentType)) |
|||
{ |
|||
<DynamicComponent Type="@customComponentType" /> |
|||
} |
|||
else |
|||
{ |
|||
<MudNavGroup> |
|||
<TitleContent> |
|||
<MudIcon Icon="@MenuItem.Icon" Title="@MenuItem.DisplayName" Size="Size.Small" /> |
|||
<MudText Class="ms-2" Inline="true">@MenuItem.DisplayName</MudText> |
|||
</TitleContent> |
|||
<ChildContent> |
|||
@foreach (var item in MenuItem.Items) |
|||
{ |
|||
<MudNavLink Href="@(item.Url?.TrimStart('/', '~') ?? "#")" Match="@(item.Url != null ? NavLinkMatch.All : NavLinkMatch.Prefix)"> |
|||
<MudIcon Icon="@item.Icon" Size="Size.Small"/> |
|||
<MudText Class="ms-2" Inline="true">@item.DisplayName</MudText> |
|||
</MudNavLink> |
|||
} |
|||
</ChildContent> |
|||
</MudNavGroup> |
|||
} |
|||
|
|||
@code { |
|||
[Parameter] |
|||
public ApplicationMenuItem MenuItem { get; set; } = default!; |
|||
|
|||
[Inject] |
|||
private NavigationManager NavigationManager { get; set; } = default!; |
|||
|
|||
protected override void OnInitialized() |
|||
{ |
|||
NavigationManager.LocationChanged += OnLocationChanged; |
|||
} |
|||
|
|||
protected virtual void OnLocationChanged(object? sender, LocationChangedEventArgs e) |
|||
{ |
|||
// Menu will close automatically on navigation |
|||
} |
|||
|
|||
public void Dispose() |
|||
{ |
|||
NavigationManager.LocationChanged -= OnLocationChanged; |
|||
} |
|||
} |
|||
|
|||
@implements IDisposable |
|||
Loading…
Reference in new issue