Skip to content

Commit ab63fc7

Browse files
committed
refactor: 增加 Toolbar 功能
1 parent 7dc6a69 commit ab63fc7

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

src/BootstrapBlazor/Components/Tab/Tab.razor

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@ else
7373
{
7474
@ButtonTemplate
7575
}
76+
@if (ShowToolbar)
77+
{
78+
<div class="tabs-nav-toolbar">
79+
@if (ShowFullscreenButton)
80+
{
81+
<div class="tabs-nav-toolbar-button">
82+
<FullScreenButton TargetId="@Id"></FullScreenButton>
83+
</div>
84+
}
85+
</div>
86+
}
7687
@if (ShowNavigatorButtons)
7788
{
7889
<div class="nav-link-bar right" @onclick="@ClickNextTab"><i class="@NextIcon"></i></div>

src/BootstrapBlazor/Components/Tab/Tab.razor.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,18 @@ public partial class Tab : IHandlerException
294294
[Parameter]
295295
public TabStyle TabStyle { get; set; }
296296

297+
/// <summary>
298+
/// Gets or sets whether show the toolbar. Default is false.
299+
/// </summary>
300+
[Parameter]
301+
public bool ShowToolbar { get; set; }
302+
303+
/// <summary>
304+
/// Gets or sets whether show the full screen button. Default is true.
305+
/// </summary>
306+
[Parameter]
307+
public bool ShowFullscreenButton { get; set; } = true;
308+
297309
[CascadingParameter]
298310
private Layout? Layout { get; set; }
299311

src/BootstrapBlazor/Components/Tab/Tab.razor.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@
197197
}
198198

199199
.tabs .tabs-body {
200+
background-color: var(--bs-body-bg);
200201
padding: var(--bb-tabs-body-padding);
201202
flex: 1;
202203
}
@@ -647,28 +648,27 @@
647648
}
648649

649650
.tabs {
650-
&:not(.tabs-vertical) > .tabs-header .tabs-nav .tabs-nav-toolbar {
651+
&:not(.tabs-vertical) > .tabs-header .tabs-nav-toolbar {
651652
display: flex;
652653
}
653654

654655
&.tabs-bottom > .tabs-header {
655-
.tabs-nav .tabs-nav-toolbar {
656+
.tabs-nav-toolbar {
656657
border-top: 1px solid var(--bs-border-color);
657658
}
658659
}
659660

660661
&:not(.tabs-bottom) > .tabs-header {
661-
.tabs-nav .tabs-nav-toolbar {
662+
.tabs-nav-toolbar {
662663
border-bottom: 1px solid var(--bs-border-color);
663664
}
664665
}
665666

666667
> .tabs-header {
667-
.tabs-nav .tabs-nav-toolbar {
668+
.tabs-nav-toolbar {
668669
display: none;
669670
align-items: center;
670671
height: 100%;
671-
padding-inline: 1rem;
672672
}
673673
}
674674
}

0 commit comments

Comments
 (0)