Skip to content

Commit 24c0dd3

Browse files
committed
(Calendar) add AdditionalHeaders Parameter #4673
1 parent 624ade0 commit 24c0dd3

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/BootstrapBlazor/Components/Calendar/Calendar.razor

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@
8686
<table cellspacing="0" cellpadding="0" class="calendar-table table-week">
8787
<thead>
8888
<tr>
89+
@if (AdditionalHeaders != null)
90+
{
91+
foreach (var item in AdditionalHeaders)
92+
{
93+
@RenderAddHeader(item)
94+
}
95+
}
8996
@for (var index = 0; index < 7; index++)
9097
{
9198
@RenderWeekHeader(index)
@@ -115,4 +122,11 @@
115122
<div>@GetWeekDayString(index)</div>
116123
</div>
117124
</th>;
125+
126+
RenderFragment<string> RenderAddHeader => name =>
127+
@<th>
128+
<div class="week-header">
129+
<div><span class="d-none d-sm-inline-block">@name</span></div>
130+
</div>
131+
</th>;
118132
}

src/BootstrapBlazor/Components/Calendar/Calendar.razor.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,12 @@ protected int GetWeekCount()
173173
[Parameter]
174174
public RenderFragment? ChildContent { get; set; }
175175

176+
/// <summary>
177+
/// 获得/设置 附加列
178+
/// </summary>
179+
[Parameter]
180+
public string[]? AdditionalHeaders { get; set; }
181+
176182
/// <summary>
177183
/// 获得/设置 单元格模板
178184
/// </summary>

0 commit comments

Comments
 (0)