Skip to content

Commit a622049

Browse files
committed
doc: 增加 Trigger 示例
1 parent 0c82946 commit a622049

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,23 @@ private Func&lt;Task&gt;? OnConfirmAsync { get; set; }</Pre>
166166
</PopConfirmButton>
167167
</DemoBlock>
168168

169+
<DemoBlock Title="@Localizer["PopoverConfirmsTriggerTitle"]"
170+
Introduction="@Localizer["PopoverConfirmsTriggerIntro"]"
171+
Name="Trigger">
172+
<PopConfirmButton Placement="Placement.Top"
173+
ConfirmIcon="fa-solid fa-triangle-exclamation text-info"
174+
Color="Color.Primary"
175+
ConfirmButtonColor="Color.Info"
176+
Trigger="hover focus" ShowCloseButton="false" ShowConfirmButton="false"
177+
Text="@Localizer["PopoverConfirmsBodyTemplateButtonText"]">
178+
<BodyTemplate>
179+
<div class="d-flex align-items-center">
180+
Label: Just a demo
181+
</div>
182+
</BodyTemplate>
183+
</PopConfirmButton>
184+
</DemoBlock>
185+
169186
<AttributeTable Items="@GetAttributes()" />
170187

171188
<EventTable Items="@GetEvents()" />

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,30 @@ private static AttributeItem[] GetAttributes() =>
166166
Type = "string",
167167
ValueList = "",
168168
DefaultValue = " "
169+
},
170+
new()
171+
{
172+
Name = nameof(PopConfirmButton.Trigger),
173+
Description = "How pop confirm is triggered",
174+
Type = "string",
175+
ValueList = "click|hover|focus",
176+
DefaultValue = "click"
177+
},
178+
new()
179+
{
180+
Name = nameof(PopConfirmButton.ShowCloseButton),
181+
Description = "Whether to display the close button",
182+
Type = "string",
183+
ValueList = "true/false",
184+
DefaultValue = "true"
185+
},
186+
new()
187+
{
188+
Name = nameof(PopConfirmButton.ShowConfirmButton),
189+
Description = "Whether to display the confirm button",
190+
Type = "string",
191+
ValueList = "true/false",
192+
DefaultValue = "true"
169193
}
170194
];
171195

0 commit comments

Comments
 (0)