Skip to content

Commit 1508c5f

Browse files
committed
refactor: 重构代码
1 parent 883d3ae commit 1508c5f

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
179179
return;
180180
}
181181

182-
if (_renderActiveTabs)
182+
if (_renderInactiveTabs)
183183
{
184184
_renderInactiveTabs = false;
185185
await InvokeVoidAsync("reloadInactiveTab", Id);
@@ -323,7 +323,15 @@ private Task LoadInactiveTabs(List<string> tabs)
323323
/// </summary>
324324
/// <param name="key"></param>
325325
/// <returns></returns>
326-
public bool IsActiveTab(string? key) => string.IsNullOrEmpty(key) ? false : _activeTabs.Contains(key);
326+
public bool IsActiveTab(string? key)
327+
{
328+
if (Renderer == DockViewRenderMode.Always)
329+
{
330+
return true;
331+
}
332+
333+
return _activeTabs.Contains(key ?? string.Empty);
334+
}
327335

328336
/// <summary>
329337
/// 锁定回调方法 由 JavaScript 调用

0 commit comments

Comments
 (0)