File tree Expand file tree Collapse file tree 6 files changed +14
-10
lines changed Expand file tree Collapse file tree 6 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,6 @@ protected override void OnParametersSet()
8383 CopiedText ??= Localizer [ nameof ( CopiedText ) ] ;
8484 }
8585
86-
8786 /// <summary>
8887 /// <inheritdoc/>
8988 /// </summary>
Original file line number Diff line number Diff line change 2929<hr />
3030
3131<div class =" tabs-coms" >
32- <Tab IsBorderCard =" true" >
32+ <Tab IsBorderCard =" true" IsLazyLoadTabItem = " true " @ref = " Tab " >
3333 <TabItem Text =" Example" Icon =" fa-solid fa-desktop" >
3434 @Body
3535 </TabItem >
3636 <TabItem Text =" Razor" Icon =" fa-brands fa-html5" >
37- <Pre CodeFile =" @RazorFileName" class =" code-razor" ></Pre >
37+ <Pre @key = " @RazorFileName " CodeFile =" @RazorFileName" class =" code-razor" ></Pre >
3838 </TabItem >
3939 <TabItem Text =" C#" Icon =" fa-regular fa-file-code" >
40- <Pre CodeFile =" @CSharpFileName" class =" code-cs" ></Pre >
40+ <Pre @key = " @CSharpFileName " CodeFile =" @CSharpFileName" class =" code-cs" ></Pre >
4141 </TabItem >
4242 <TabItem Text =" @Video" Icon =" fa-regular fa-file-video" >
4343 <Video @key =" @VideoFileName" Name =" @VideoFileName" ></Video >
Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ public partial class ComponentLayout : IAsyncDisposable
4343 [ NotNull ]
4444 private IJSRuntime ? JSRuntime { get ; set ; }
4545
46+ [ NotNull ]
47+ private Tab ? Tab { get ; set ; }
48+
4649 /// <summary>
4750 /// Instance of <see cref="JSModule"/>
4851 /// </summary>
@@ -97,6 +100,8 @@ protected override void OnParametersSet()
97100 RazorFileName = $ "{ comName } .razor";
98101 CSharpFileName = $ "{ comName } .razor.cs";
99102 VideoFileName = comName ;
103+
104+ Tab ? . ActiveTab ( 0 ) ;
100105 }
101106
102107 /// <summary>
Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk.Razor" >
22
33 <PropertyGroup >
4- <Version >7.8.11 </Version >
4+ <Version >7.9.0 </Version >
55 </PropertyGroup >
66
77 <ItemGroup Condition =" '$(TargetFramework)' == 'net5.0'" >
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ namespace BootstrapBlazor.Components;
99/// <summary>
1010/// 懒加载组件
1111/// </summary>
12- public partial class LazyLoading : ComponentBase
12+ public partial class LazyLoad : ComponentBase
1313{
1414 /// <summary>
1515 /// 获得/设置 子组件
Original file line number Diff line number Diff line change 44
55namespace UnitTest . Components ;
66
7- public class LazyLoadingTest : TestBase
7+ public class LazyLoadTest : TestBase
88{
99 [ Fact ]
1010 public void LazyLoading_Ok ( )
1111 {
12- var cut = Context . RenderComponent < LazyLoading > ( pb =>
12+ var cut = Context . RenderComponent < LazyLoad > ( pb =>
1313 {
1414 pb . Add ( a => a . ChildContent , "<div>content</div>" ) ;
1515 } ) ;
@@ -19,7 +19,7 @@ public void LazyLoading_Ok()
1919 [ Fact ]
2020 public void OnLoadCallbackAsync_Ok ( )
2121 {
22- var cut = Context . RenderComponent < LazyLoading > ( pb =>
22+ var cut = Context . RenderComponent < LazyLoad > ( pb =>
2323 {
2424 pb . Add ( a => a . OnLoadCallbackAsync , ( ) => Task . FromResult ( false ) ) ;
2525 pb . Add ( a => a . ChildContent , "<div>content</div>" ) ;
@@ -31,7 +31,7 @@ public void OnLoadCallbackAsync_Ok()
3131 public void OnFirstLoadCallbackAsync_Ok ( )
3232 {
3333 var load = false ;
34- var cut = Context . RenderComponent < LazyLoading > ( pb =>
34+ var cut = Context . RenderComponent < LazyLoad > ( pb =>
3535 {
3636 pb . Add ( a => a . OnLoadCallbackAsync , ( ) => Task . FromResult ( true ) ) ;
3737 pb . Add ( a => a . OnFirstLoadCallbackAsync , ( ) =>
You can’t perform that action at this time.
0 commit comments