From 656c028bd2e497a3f1aaea23b18216637979c423 Mon Sep 17 00:00:00 2001 From: SamXMG <53416733+SamXMG@users.noreply.github.com> Date: Mon, 5 Aug 2024 17:21:51 +0800 Subject: [PATCH] fix(Layout): can't collapse side when set side with value (#3977) Co-authored-by: SamXMG Co-authored-by: Argo Zhang --- src/BootstrapBlazor/Components/Layout/Layout.razor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BootstrapBlazor/Components/Layout/Layout.razor.cs b/src/BootstrapBlazor/Components/Layout/Layout.razor.cs index 2e94b9adb..a02db2625 100644 --- a/src/BootstrapBlazor/Components/Layout/Layout.razor.cs +++ b/src/BootstrapBlazor/Components/Layout/Layout.razor.cs @@ -252,7 +252,7 @@ public partial class Layout : IHandlerException /// 获得 侧边栏 Style 字符串 /// private string? SideStyleString => CssBuilder.Default() - .AddClass($"width: {SideWidth.ConvertToPercentString()}", !string.IsNullOrEmpty(SideWidth) && SideWidth != "0") + .AddClass($"width: {SideWidth.ConvertToPercentString()}", !IsCollapsed && !string.IsNullOrEmpty(SideWidth) && SideWidth != "0") .Build(); ///