Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/BootstrapBlazor/BootstrapBlazor.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup Condition="'$(VisualStudioVersion)' == '17.0'">
<Version>9.11.5-beta09</Version>
<Version>9.11.5-beta10</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(VisualStudioVersion)' == '18.0'">
<Version>10.0.0-rc.2.1.8</Version>
<Version>10.0.0-rc.2.1.9</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/Components/Layout/Layout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
ShowRefreshToolbarButton="ShowRefreshToolbarButton" ShowFullscreenToolbarButton="ShowFullscreenToolbarButton"
RefreshToolbarButtonIcon="@RefreshToolbarButtonIcon" FullscreenToolbarButtonIcon="@FullscreenToolbarButtonIcon"
RefreshToolbarTooltipText="@RefreshToolbarTooltipText" FullscreenToolbarTooltipText="@FullscreenToolbarTooltipText"
OnToolbarRefreshCallback="OnToolbarRefreshCallback" TabHeader="TabHeader"
OnToolbarRefreshCallback="OnToolbarRefreshCallback" TabHeader="TabHeader" OnCloseTabItemAsync="OnCloseTabItemAsync"
Body="@Main" NotAuthorized="NotAuthorized!" NotFound="NotFound!" NotFoundTabText="@NotFoundTabText"
EnableErrorLogger="@EnableLogger" ErrorLoggerToastTitle="@ErrorLoggerToastTitle">
</Tab>;
Expand Down
7 changes: 7 additions & 0 deletions src/BootstrapBlazor/Components/Layout/Layout.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ public partial class Layout : IHandlerException, ITabHeader
[Parameter]
public Func<Task>? OnToolbarRefreshCallback { get; set; }

/// <summary>
/// 获得/设置 关闭标签页前回调方法
/// </summary>
/// <remarks>返回 false 时不关闭 <see cref="TabItem"/> 标签页</remarks>
[Parameter]
public Func<TabItem, Task<bool>>? OnCloseTabItemAsync { get; set; }

/// <summary>
/// 获得/设置 侧边栏状态
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/Components/Tab/Tab.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public partial class Tab
/// <summary>
/// 关闭标签页回调方法
/// </summary>
/// <remarks>返回 false 时不关 <see cref="TabItem"/> 标签页</remarks>
/// <remarks>返回 false 时不关闭 <see cref="TabItem"/> 标签页</remarks>
[Parameter]
public Func<TabItem, Task<bool>>? OnCloseTabItemAsync { get; set; }

Expand Down
5 changes: 3 additions & 2 deletions test/UnitTest/Components/LayoutTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public async Task TabStyle_Ok()
pb.Add(a => a.OnToolbarRefreshCallback, () => Task.CompletedTask);
pb.Add(a => a.RefreshToolbarTooltipText, "test-refresh-tooltip");
pb.Add(a => a.FullscreenToolbarTooltipText, "test-fullscreen-tooltip");
pb.Add(a => a.OnCloseTabItemAsync, tab => Task.FromResult(true));
});
Assert.DoesNotContain("tabs-chrome", cut.Markup);
Assert.DoesNotContain("tabs-capsule", cut.Markup);
Expand Down Expand Up @@ -647,7 +648,7 @@ public void ErrorLogger_OnErrorHandleAsync_Button()
var layout = cut.FindComponent<Layout>();
layout.SetParametersAndRender(pb =>
{
pb.Add(a => a.OnErrorHandleAsync, null);
pb.Add(a => a.OnErrorHandleAsync, null);
});
button = cut.Find("button");

Expand Down Expand Up @@ -727,6 +728,6 @@ protected override void OnInitialized()
var b = 0;

// 触发生命周期内异常
var c = a / b;
var c = a / b;
}
}
Loading