Skip to content

Commit d9ff481

Browse files
committed
feat: GotoTop 支持 Layout 固定标签页
1 parent 6602036 commit d9ff481

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/BootstrapBlazor/Components/Layout/Layout.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
@Footer
136136
@if (ShowGotoTop)
137137
{
138-
<GoTop />
138+
<GoTop Target="@GetTargetString()" />
139139
}
140140
</footer>;
141141
}

src/BootstrapBlazor/Components/Layout/Layout.razor.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,6 @@ public partial class Layout : IHandlerException
327327

328328
private bool _init { get; set; }
329329

330-
//private bool _isInteractive = true;
331-
332330
/// <summary>
333331
/// <inheritdoc/>
334332
/// </summary>
@@ -343,10 +341,6 @@ protected override void OnInitialized()
343341
}
344342

345343
ErrorLogger?.Register(this);
346-
347-
#if NET9_0_OR_GREATER
348-
//_isInteractive = RendererInfo.IsInteractive;
349-
#endif
350344
}
351345

352346
/// <summary>
@@ -505,6 +499,8 @@ public virtual Task HandlerException(Exception ex, RenderFragment<Exception> err
505499
return Task.CompletedTask;
506500
}
507501

502+
private string? GetTargetString() => IsFixedTabHeader ? ".tabs-body" : null;
503+
508504
/// <summary>
509505
/// <inheritdoc/>
510506
/// </summary>

0 commit comments

Comments
 (0)