fix: 侧边栏链接支持 pathbase

This commit is contained in:
argo zhang 2020-02-11 14:10:19 +08:00
parent 4bb1612b3f
commit 1867653767
2 changed files with 9 additions and 3 deletions

View File

@ -9,6 +9,12 @@ namespace Bootstrap.Admin.Pages.Components
/// </summary>
public class SideBarBase : ComponentBase
{
/// <summary>
/// 获得 NavigationManager 实例
/// </summary>
[Inject]
public NavigationManager? NavigationManager { get; set; }
/// <summary>
/// 获得/设置 侧边栏绑定 Model 实例
/// </summary>

View File

@ -3,14 +3,14 @@
<aside class="@Model.ShowSideBar">
<div class="bg"></div>
<div class="nav-brand justify-content-center">
<a href="@RootLayout.HomeUrl">
<a href="@NavigationManager.ToBlazorLink(RootLayout.HomeUrl)">
<img src="@Model.WebSiteLogo.ToBlazorLink()" />
<span>@Model.Title</span>
</a>
</div>
<div class="nav-header flex-fill align-items-center">
<a href="/Pages/Admin/Profiles">
<img src="@Model.Icon.ToBlazorLink()" />
<a href="@NavigationManager.ToBlazorLink("/Pages/Admin/Profiles")">
<img src="@NavigationManager.ToBlazorLink(Model.Icon.ToBlazorLink())" />
<span class="username d-inline-block text-truncate flex-fill">@DisplayName</span>
</a>
</div>