Skip to content

Commit a7d97e5

Browse files
committed
doc: 更新示例
1 parent c469aa5 commit a7d97e5

File tree

2 files changed

+30
-9
lines changed

2 files changed

+30
-9
lines changed

src/BootstrapBlazor.Server/Components/Samples/DateTimePickers.razor

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@
55
<h4>@Localizer["Description"]</h4>
66

77
<DemoBlock Title="@Localizer["DateTimePickerTitle"]" Introduction="@Localizer["DateTimePickerIntro"]" Name="DateTimePicker">
8-
<DateTimePicker ViewMode="DatePickerViewMode.DateTime" TimeFormat="hh\:mm"
8+
<section ignore class="row g-3 mb-3">
9+
<div class="col-12 col-sm-6">
10+
<BootstrapInputGroup>
11+
<BootstrapInputGroupLabel DisplayText="IsButton"></BootstrapInputGroupLabel>
12+
<Switch @bind-Value="_isButton"></Switch>
13+
</BootstrapInputGroup>
14+
</div>
15+
</section>
16+
<DateTimePicker ViewMode="DatePickerViewMode.DateTime" TimeFormat="hh\:mm" IsButton="_isButton"
917
Value="@DateTimePickerValue" OnValueChanged="@TimePickerValueChanged">
1018
<TimePickerSetting ShowClockScale="true" IsAutoSwitch="false" />
1119
</DateTimePicker>
@@ -16,17 +24,29 @@
1624
<section ignore>
1725
<GroupBox Title="@Localizer["Feature"]">
1826
<div class="row g-3 form-inline text-end">
19-
<div class="col-12 col-sm-3">
20-
<Switch DisplayText="@Localizer["FeatureShowLunar"]" ShowLabel="true" @bind-Value="_showLunar" />
27+
<div class="col-12 col-sm-6 col-lg-3">
28+
<BootstrapInputGroup>
29+
<BootstrapInputGroupLabel DisplayText="@Localizer["FeatureShowLunar"]"></BootstrapInputGroupLabel>
30+
<Switch @bind-Value="_showLunar" />
31+
</BootstrapInputGroup>
2132
</div>
22-
<div class="col-12 col-sm-3">
23-
<Switch DisplayText="@Localizer["FeatureShowSolarTerm"]" ShowLabel="true" @bind-Value="_showSolarTerm" />
33+
<div class="col-12 col-sm-6 col-lg-3">
34+
<BootstrapInputGroup>
35+
<BootstrapInputGroupLabel DisplayText="@Localizer["FeatureShowSolarTerm"]"></BootstrapInputGroupLabel>
36+
<Switch @bind-Value="_showSolarTerm" />
37+
</BootstrapInputGroup>
2438
</div>
25-
<div class="col-12 col-sm-3">
26-
<Switch DisplayText="@Localizer["FeatureShowFestivals"]" ShowLabel="true" @bind-Value="_showFestivals" />
39+
<div class="col-12 col-sm-6 col-lg-3">
40+
<BootstrapInputGroup>
41+
<BootstrapInputGroupLabel DisplayText="@Localizer["FeatureShowFestivals"]"></BootstrapInputGroupLabel>
42+
<Switch @bind-Value="_showFestivals" />
43+
</BootstrapInputGroup>
2744
</div>
28-
<div class="col-12 col-sm-3">
29-
<Switch DisplayText="@Localizer["FeatureShowHolidays"]" ShowLabel="true" @bind-Value="_showHolidays" />
45+
<div class="col-12 col-sm-6 col-lg-3">
46+
<BootstrapInputGroup>
47+
<BootstrapInputGroupLabel DisplayText="@Localizer["FeatureShowHolidays"]"></BootstrapInputGroupLabel>
48+
<Switch @bind-Value="_showHolidays" />
49+
</BootstrapInputGroup>
3050
</div>
3151
</div>
3252
</GroupBox>

src/BootstrapBlazor.Server/Components/Samples/DateTimePickers.razor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ private string BindValueString
9595
private bool _disableToday = true;
9696
private DateTime? _disabledNullValue = DateTime.Today;
9797
private DateTime _disabledValue = DateTime.Today;
98+
private bool _isButton = false;
9899

99100
private async Task<List<DateTime>> OnGetDisabledDaysCallback(DateTime start, DateTime end)
100101
{

0 commit comments

Comments
 (0)