fix: 侧边栏链接支持 pathbase
This commit is contained in:
parent
4bb1612b3f
commit
1867653767
|
@ -9,6 +9,12 @@ namespace Bootstrap.Admin.Pages.Components
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class SideBarBase : ComponentBase
|
public class SideBarBase : ComponentBase
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获得 NavigationManager 实例
|
||||||
|
/// </summary>
|
||||||
|
[Inject]
|
||||||
|
public NavigationManager? NavigationManager { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获得/设置 侧边栏绑定 Model 实例
|
/// 获得/设置 侧边栏绑定 Model 实例
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -3,14 +3,14 @@
|
||||||
<aside class="@Model.ShowSideBar">
|
<aside class="@Model.ShowSideBar">
|
||||||
<div class="bg"></div>
|
<div class="bg"></div>
|
||||||
<div class="nav-brand justify-content-center">
|
<div class="nav-brand justify-content-center">
|
||||||
<a href="@RootLayout.HomeUrl">
|
<a href="@NavigationManager.ToBlazorLink(RootLayout.HomeUrl)">
|
||||||
<img src="@Model.WebSiteLogo.ToBlazorLink()" />
|
<img src="@Model.WebSiteLogo.ToBlazorLink()" />
|
||||||
<span>@Model.Title</span>
|
<span>@Model.Title</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-header flex-fill align-items-center">
|
<div class="nav-header flex-fill align-items-center">
|
||||||
<a href="/Pages/Admin/Profiles">
|
<a href="@NavigationManager.ToBlazorLink("/Pages/Admin/Profiles")">
|
||||||
<img src="@Model.Icon.ToBlazorLink()" />
|
<img src="@NavigationManager.ToBlazorLink(Model.Icon.ToBlazorLink())" />
|
||||||
<span class="username d-inline-block text-truncate flex-fill">@DisplayName</span>
|
<span class="username d-inline-block text-truncate flex-fill">@DisplayName</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue