Browse Source
Merge pull request #6774 from abpframework/liangshiwei/blazor-theme
Blazor theme menu supports target
pull/6778/head
Ahmet Çotur
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
14 additions and
6 deletions
-
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/FirstLevelNavMenuItem.razor
-
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/LoginDisplay.razor
-
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Themes/Basic/SecondLevelNavMenuItem.razor
|
|
|
@ -10,7 +10,7 @@ |
|
|
|
if (MenuItem.Url != null) |
|
|
|
{ |
|
|
|
<li class="nav-item @cssClass @disabled" id="@elementId"> |
|
|
|
<a class="nav-link" href="@url"> |
|
|
|
<a class="nav-link" href="@url" target="@MenuItem.Target"> |
|
|
|
@if (MenuItem.Icon != null) |
|
|
|
{ |
|
|
|
if (MenuItem.Icon.StartsWith("fa")) |
|
|
|
|
|
|
|
@ -3,6 +3,7 @@ |
|
|
|
@using Volo.Abp.MultiTenancy |
|
|
|
@inject ICurrentUser CurrentUser |
|
|
|
@inject ICurrentTenant CurrentTenant |
|
|
|
@inject IJSRuntime JsRuntime |
|
|
|
@inject NavigationManager Navigation |
|
|
|
@inject SignOutSessionStateManager SignOutManager |
|
|
|
<AuthorizeView> |
|
|
|
@ -23,7 +24,7 @@ |
|
|
|
{ |
|
|
|
@foreach (var menuItem in Menu.Items) |
|
|
|
{ |
|
|
|
<DropdownItem Clicked="@(() => NavigateTo(menuItem.Url))">@menuItem.DisplayName</DropdownItem> |
|
|
|
<DropdownItem Clicked="@(() => NavigateToAsync(menuItem.Url, menuItem.Target))">@menuItem.DisplayName</DropdownItem> |
|
|
|
} |
|
|
|
} |
|
|
|
<DropdownDivider /> |
|
|
|
@ -37,14 +38,21 @@ |
|
|
|
</AuthorizeView> |
|
|
|
@code{ |
|
|
|
|
|
|
|
private void NavigateTo(string uri) |
|
|
|
private async Task NavigateToAsync(string uri, string target = null) |
|
|
|
{ |
|
|
|
Navigation.NavigateTo(uri); |
|
|
|
if (target == "_blank") |
|
|
|
{ |
|
|
|
await JsRuntime.InvokeVoidAsync("open", uri, target); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
Navigation.NavigateTo(uri); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private async Task BeginSignOut() |
|
|
|
{ |
|
|
|
await SignOutManager.SetSignOutState(); |
|
|
|
NavigateTo("authentication/logout"); |
|
|
|
await NavigateToAsync("authentication/logout"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -9,7 +9,7 @@ |
|
|
|
{ |
|
|
|
if (MenuItem.Url != null) |
|
|
|
{ |
|
|
|
<a class="dropdown-item @cssClass @disabled" href="@url" id="@elementId"> |
|
|
|
<a class="dropdown-item @cssClass @disabled" href="@url" target="@MenuItem.Target" id="@elementId"> |
|
|
|
@if (MenuItem.Icon != null) |
|
|
|
{ |
|
|
|
if (MenuItem.Icon.StartsWith("fa")) |
|
|
|
|