File tree Expand file tree Collapse file tree 4 files changed +44
-1
lines changed Expand file tree Collapse file tree 4 files changed +44
-1
lines changed Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk.Razor" >
22
33 <PropertyGroup >
4- <Version >9.3.1-beta19 </Version >
4+ <Version >9.3.1-beta21 </Version >
55 </PropertyGroup >
66
77 <ItemGroup >
Original file line number Diff line number Diff line change 1111 <div @attributes =" @AdditionalAttributes" id =" @Id" class =" @ClassString" style =" @StyleString " >
1212 <div class =" tabs-header" >
1313 <div class =" @WrapClassString" >
14+ @if (BeforeNavigatorTemplate != null )
15+ {
16+ @BeforeNavigatorTemplate
17+ }
1418 @if (ShowNavigatorButtons )
1519 {
1620 <div class =" nav-link-bar left" @onclick =" @ClickPrevTab" ><i class =" @PreviousIcon" ></i ></div >
@@ -106,6 +110,10 @@ else
106110 <div class =" dropdown-item" @onclick =" @OnClickCloseAllTabs" ><span >@CloseAllTabsText </span ></div >
107111 </div >
108112 }
113+ @if (AfterNavigatorTemplate != null )
114+ {
115+ @AfterNavigatorTemplate
116+ }
109117 </div >
110118 </div >
111119 <div class =" tabs-body" >
Original file line number Diff line number Diff line change @@ -226,6 +226,20 @@ public partial class Tab : IHandlerException
226226 [ Parameter ]
227227 public RenderFragment ? ButtonTemplate { get ; set ; }
228228
229+ /// <summary>
230+ /// 获得/设置 标签页前置模板 默认 null
231+ /// <para>在向前移动标签页按钮前</para>
232+ /// </summary>
233+ [ Parameter ]
234+ public RenderFragment ? BeforeNavigatorTemplate { get ; set ; }
235+
236+ /// <summary>
237+ /// 获得/设置 标签页后置模板 默认 null
238+ /// <para>在向后移动标签页按钮前</para>
239+ /// </summary>
240+ [ Parameter ]
241+ public RenderFragment ? AfterNavigatorTemplate { get ; set ; }
242+
229243 /// <summary>
230244 /// 获得/设置 上一个标签图标
231245 /// </summary>
Original file line number Diff line number Diff line change @@ -877,6 +877,27 @@ public async Task FullScreen_Ok()
877877 await cut . InvokeAsync ( ( ) => button . Click ( ) ) ;
878878 }
879879
880+ [ Fact ]
881+ public void BeforeNavigatorTemplate_Ok ( )
882+ {
883+ var cut = Context . RenderComponent < BootstrapBlazorRoot > ( pb =>
884+ {
885+ pb . AddChildContent < Tab > ( pb =>
886+ {
887+ pb . Add ( a => a . BeforeNavigatorTemplate , builder => builder . AddContent ( 0 , "before-navigator-template" ) ) ;
888+ pb . Add ( a => a . AfterNavigatorTemplate , builder => builder . AddContent ( 0 , "after-navigator-template" ) ) ;
889+ pb . AddChildContent < TabItem > ( pb =>
890+ {
891+ pb . Add ( a => a . ShowFullScreen , true ) ;
892+ pb . Add ( a => a . Text , "Text1" ) ;
893+ pb . Add ( a => a . ChildContent , builder => builder . AddContent ( 0 , "Test1" ) ) ;
894+ } ) ;
895+ } ) ;
896+ } ) ;
897+ cut . Contains ( "before-navigator-template" ) ;
898+ cut . Contains ( "after-navigator-template" ) ;
899+ }
900+
880901 class DisableTabItemButton : ComponentBase
881902 {
882903 [ CascadingParameter , NotNull ]
You can’t perform that action at this time.
0 commit comments