Skip to content

Commit 7cb896e

Browse files
authored
Update BasicLayout.razor.cs
Add a fold width so that the fold width can be set
1 parent 4e9ed0a commit 7cb896e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/layout/src/BasicLayout.razor.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public partial class BasicLayout : IBasicLayout
4242
[Parameter] public OneOf<string, RenderFragment> Logo { get; set; }
4343
[Parameter] public string BaseURL { get; set; } = "";
4444
[Parameter] public int SiderWidth { get; set; } = 208;
45+
[Parameter] public int FoldedSiderWidth { get; set; } = 48;
4546
[Parameter] public RenderFragment MenuExtraRender { get; set; }
4647
[Parameter] public bool MenuAccordion { get; set; }
4748
[Parameter] public RenderFragment<bool> CollapsedButtonRender { get; set; }
@@ -80,7 +81,7 @@ protected override void OnParametersSet()
8081
protected void SetStyle()
8182
{
8283
var hasLeftPadding = FixSiderbar && Layout != Layout.Top && !IsMobile;
83-
var paddingLeft = hasLeftPadding ? Collapsed ? 48 : SiderWidth : 0;
84+
var paddingLeft = hasLeftPadding ? Collapsed ? FoldedSiderWidth : SiderWidth : 0;
8485

8586
_genLayoutStyle = MenuRender ? $"padding-left: {paddingLeft}px; position: relative;" : "";
8687
_weakModeStyle = ColorWeak ? "filter: invert(80%);" : "";
@@ -126,4 +127,4 @@ private async Task HandleCollapse(bool collapsed)
126127

127128
}
128129
}
129-
}
130+
}

0 commit comments

Comments
 (0)