diff --git a/src/admin/Bootstrap.Admin/Pages/Components/DefaultLayoutComponentBase.cs b/src/admin/Bootstrap.Admin/Pages/Components/DefaultLayoutComponentBase.cs index 27887919..649773b4 100644 --- a/src/admin/Bootstrap.Admin/Pages/Components/DefaultLayoutComponentBase.cs +++ b/src/admin/Bootstrap.Admin/Pages/Components/DefaultLayoutComponentBase.cs @@ -115,11 +115,17 @@ namespace Bootstrap.Admin.Pages.Components /// /// 设置参数方法 /// - protected override void OnParametersSet() + public override Task SetParametersAsync(ParameterView parameters) { - RequestUrl = new UriBuilder(NavigationManager?.Uri ?? "").Path; - Model = new NavigatorBarModel(UserName, RequestUrl.ToMvcMenuUrl()); - DisplayName = Model.DisplayName; + parameters.SetParameterProperties(this); + if (NavigationManager != null) + { + RequestUrl = new UriBuilder(NavigationManager.Uri).Path; + Model = new NavigatorBarModel(UserName, RequestUrl.ToMvcMenuUrl()); + DisplayName = Model.DisplayName; + HomeUrl = NavigationManager.ToBlazorLink(HomeUrl); + } + return base.SetParametersAsync(ParameterView.Empty); } /// diff --git a/src/admin/Bootstrap.Admin/Pages/Components/SideBarBase.cs b/src/admin/Bootstrap.Admin/Pages/Components/SideBarBase.cs index 26f718ab..58fc6646 100644 --- a/src/admin/Bootstrap.Admin/Pages/Components/SideBarBase.cs +++ b/src/admin/Bootstrap.Admin/Pages/Components/SideBarBase.cs @@ -25,7 +25,7 @@ namespace Bootstrap.Admin.Pages.Components /// 获得 根模板页实例 /// [CascadingParameter(Name = "Default")] - public DefaultLayout RootLayout { get; protected set; } = new DefaultLayout(); + public DefaultLayout? RootLayout { get; protected set; } /// /// 获得/设置 用户显示名称 diff --git a/src/admin/Bootstrap.Admin/Pages/Shared/SideBar.razor b/src/admin/Bootstrap.Admin/Pages/Shared/SideBar.razor index 0a3ed0d4..f3edeba9 100644 --- a/src/admin/Bootstrap.Admin/Pages/Shared/SideBar.razor +++ b/src/admin/Bootstrap.Admin/Pages/Shared/SideBar.razor @@ -3,7 +3,7 @@