Skip to content

Commit 91cb3b4

Browse files
committed
doc: 更新示例
1 parent 3fbd406 commit 91cb3b4

File tree

2 files changed

+33
-30
lines changed

2 files changed

+33
-30
lines changed
Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
@page "/otp-input"
22
@inject IStringLocalizer<OtpInputs> Localizer
33

4+
<HeadContent>
5+
<style>
6+
.input-group-text {
7+
--bb-input-group-label-width: 100px;
8+
}
9+
</style>
10+
</HeadContent>
11+
412
<h3>@Localizer["OtpInputsTitle"]</h3>
513

614
<h4>@Localizer["OtpInputsDescription"]</h4>
@@ -9,45 +17,34 @@
917
<p>@((MarkupString)Localizer["OtpInputsTips"].Value)</p>
1018
</Tips>
1119

12-
<DemoBlock Title="@Localizer["OtpInputsNormalTitle"]"
13-
Introduction="@Localizer["OtpInputsNormalIntro"]"
14-
Name="Normal">
15-
<OtpInput Value="@_value"></OtpInput>
16-
</DemoBlock>
17-
18-
<DemoBlock Title="@Localizer["OtpInputsReadonlyTitle"]"
19-
Introduction="@Localizer["OtpInputsReadonlyIntro"]"
20-
Name="Readonly">
21-
<OtpInput Value="@_value" IsReadonly="true"></OtpInput>
22-
</DemoBlock>
23-
24-
<DemoBlock Title="@Localizer["OtpInputsDisabledTitle"]"
25-
Introduction="@Localizer["OtpInputsDisabledIntro"]"
26-
Name="Disabled">
27-
<OtpInput Value="@_value" IsDisabled="true"></OtpInput>
28-
</DemoBlock>
29-
30-
<DemoBlock Title="@Localizer["OtpInputsTypeTitle"]"
31-
Introduction="@Localizer["OtpInputsTypeIntro"]"
32-
Name="Type">
33-
<div class="row g-3">
34-
<div class="col-12"><Select @bind-Value="_otpInputType"></Select></div>
35-
<div class="col-12"><OtpInput Value="@_value" Type="_otpInputType"></OtpInput></div>
36-
</div>
37-
</DemoBlock>
38-
3920
<DemoBlock Title="@Localizer["OtpInputsTypeTitle"]"
4021
Introduction="@Localizer["OtpInputsTypeIntro"]"
4122
Name="Type">
42-
<div class="row g-3">
23+
<div class="row g-3 mb-3">
4324
<div class="col-12 col-sm-6">
4425
<BootstrapInputGroup>
4526
<BootstrapInputGroupLabel DisplayText="Type"></BootstrapInputGroupLabel>
4627
<Select @bind-Value="_otpInputType"></Select>
4728
</BootstrapInputGroup>
4829
</div>
49-
<div class="col-12">
30+
<div class="col-12 col-sm-6">
31+
<BootstrapInputGroup>
32+
<BootstrapInputGroupLabel DisplayText="PlaceHolder"></BootstrapInputGroupLabel>
33+
<BootstrapInput @bind-Value="@_placeHolder"></BootstrapInput>
34+
</BootstrapInputGroup>
35+
</div>
36+
<div class="col-12 col-sm-6">
37+
<BootstrapInputGroup>
38+
<BootstrapInputGroupLabel DisplayText="Readonly"></BootstrapInputGroupLabel>
39+
<Switch @bind-Value="@_readonly"></Switch>
40+
</BootstrapInputGroup>
41+
</div>
42+
<div class="col-12 col-sm-6">
43+
<BootstrapInputGroup>
44+
<BootstrapInputGroupLabel DisplayText="Disable"></BootstrapInputGroupLabel>
45+
<Switch @bind-Value="@_disabled"></Switch>
46+
</BootstrapInputGroup>
5047
</div>
5148
</div>
52-
<OtpInput Value="@_value" Type="_otpInputType"></OtpInput>
49+
<OtpInput Value="@_value" Type="_otpInputType" PlaceHolder="@_placeHolder" IsReadonly="_readonly" IsDisabled="_disabled"></OtpInput>
5350
</DemoBlock>

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,10 @@ public partial class OtpInputs
1313
private string _value = "818924";
1414

1515
private OtpInputType _otpInputType;
16+
17+
private string _placeHolder = "X";
18+
19+
private bool _readonly = false;
20+
21+
private bool _disabled = false;
1622
}

0 commit comments

Comments
 (0)