From 3e11ca1dd662870338a86dd61e104d4cadf63cda Mon Sep 17 00:00:00 2001 From: Argo-AsicoTech Date: Sun, 13 Oct 2024 19:54:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20=E5=A2=9E=E5=8A=A0=E9=83=A8?= =?UTF-8?q?=E5=88=86=20Tab=20=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Layout/Layout.razor | 6 ++++-- .../Components/Layout/Layout.razor.cs | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/BootstrapBlazor/Components/Layout/Layout.razor b/src/BootstrapBlazor/Components/Layout/Layout.razor index d8348eefac8..dda85eee0be 100644 --- a/src/BootstrapBlazor/Components/Layout/Layout.razor +++ b/src/BootstrapBlazor/Components/Layout/Layout.razor @@ -118,10 +118,12 @@ @
@if (UseTabSet) { - + Body="@Main" NotAuthorized="NotAuthorized!" NotFound="NotFound!"> + } else { diff --git a/src/BootstrapBlazor/Components/Layout/Layout.razor.cs b/src/BootstrapBlazor/Components/Layout/Layout.razor.cs index a02db262527..c38bbb4bbdf 100644 --- a/src/BootstrapBlazor/Components/Layout/Layout.razor.cs +++ b/src/BootstrapBlazor/Components/Layout/Layout.razor.cs @@ -181,6 +181,24 @@ public partial class Layout : IHandlerException [Parameter] public string TabDefaultUrl { get; set; } = ""; + /// + /// 获得/设置 标签是否显示关闭按钮 默认 true + /// + [Parameter] + public bool ShowTabItemClose { get; set; } = true; + + /// + /// 获得/设置 标签是否显示扩展按钮 默认 true + /// + [Parameter] + public bool ShowTabExtendButtons { get; set; } = true; + + /// + /// 获得/设置 点击标签页是否切换地址栏 默认 true + /// + [Parameter] + public bool ClickTabToNavigation { get; set; } = true; + /// /// 获得/设置 授权回调方法多用于权限控制 /// From 8b737afbb89eae9afbc6433e7bc8c2eafac1a7f9 Mon Sep 17 00:00:00 2001 From: Argo-AsicoTech Date: Sun, 13 Oct 2024 20:00:47 +0800 Subject: [PATCH 2/2] =?UTF-8?q?test:=20=E5=A2=9E=E5=8A=A0=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/UnitTest/Components/LayoutTest.cs | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/test/UnitTest/Components/LayoutTest.cs b/test/UnitTest/Components/LayoutTest.cs index 334c1abf811..bec7553a8ff 100644 --- a/test/UnitTest/Components/LayoutTest.cs +++ b/test/UnitTest/Components/LayoutTest.cs @@ -218,6 +218,43 @@ public void UseTabSet_Menus() cut.WaitForAssertion(() => cut.Contains("
Binder
")); } + [Fact] + public void UseTabSet_ShowTabExtendButtons() + { + var cut = Context.RenderComponent(pb => + { + pb.Add(a => a.UseTabSet, true); + pb.Add(a => a.AdditionalAssemblies, new Assembly[] { GetType().Assembly }); + pb.Add(a => a.ShowTabExtendButtons, false); + }); + cut.DoesNotContain("