Skip to content

Commit 67373bd

Browse files
committed
refactor: 精简代码
1 parent 041ae59 commit 67373bd

File tree

2 files changed

+1
-32
lines changed

2 files changed

+1
-32
lines changed

src/BootstrapBlazor/Components/Layout/Layout.razor

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
DefaultUrl="@TabDefaultUrl" ExcludeUrls="@ExcludeUrls" IsOnlyRenderActiveTab="IsOnlyRenderActiveTab"
131131
TabStyle="TabStyle" ShowToolbar="@ShowToolbar" ToolbarTemplate="@ToolbarTemplate"
132132
ShowContextMenu="ShowTabContextMenu"
133+
BeforeContextMenuTemplate="@BeforeTabContextMenuTemplate" ContextMenuTemplate="@TabContextMenuTemplate"
133134
ContextMenuRefreshIcon="@TabContextMenuRefreshIcon" ContextMenuCloseIcon="@TabContextMenuCloseIcon"
134135
ContextMenuCloseOtherIcon="@TabContextMenuCloseOtherIcon" ContextMenuCloseAllIcon="@TabContextMenuCloseAllIcon"
135136
ShowRefreshToolbarButton="ShowRefreshToolbarButton" ShowFullscreenToolbarButton="ShowFullscreenToolbarButton"

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

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -623,38 +623,6 @@ public virtual Task HandlerException(Exception ex, RenderFragment<Exception> err
623623

624624
private string? GetTargetString() => IsFixedTabHeader ? ".tabs-body" : null;
625625

626-
private async Task OnRefresh(ContextMenuItem item, object? context)
627-
{
628-
if (context is TabItem tabItem)
629-
{
630-
await _tab.Refresh(tabItem);
631-
}
632-
}
633-
634-
private async Task OnClose(ContextMenuItem item, object? context)
635-
{
636-
if (context is TabItem tabItem)
637-
{
638-
await _tab.RemoveTab(tabItem);
639-
}
640-
}
641-
642-
private Task OnCloseOther(ContextMenuItem item, object? context)
643-
{
644-
if (context is TabItem tabItem)
645-
{
646-
_tab.ActiveTab(tabItem);
647-
}
648-
_tab.CloseOtherTabs();
649-
return Task.CompletedTask;
650-
}
651-
652-
private Task OnCloseAll(ContextMenuItem item, object? context)
653-
{
654-
_tab.CloseAllTabs();
655-
return Task.CompletedTask;
656-
}
657-
658626
/// <summary>
659627
/// <inheritdoc/>
660628
/// </summary>

0 commit comments

Comments
 (0)