doc(Dialog): add docment for ShowModal dialog service (#4748)
Some checks are pending
Build project / build (push) Waiting to run

* test: 更新单元测试

* doc(Dialog): add docment for ShowModal dialog service
This commit is contained in:
Argo Zhang 2024-11-27 03:53:34 -08:00 committed by GitHub
parent 8160795701
commit 81e8297038
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 1 deletions

View File

@ -57,6 +57,24 @@ private DialogService? DialogService { get; set; }</Pre>
<p> <code>ResultDialogDemo</code> <code></code> <code></code> </p>
</GroupBox>
<GroupBox Title="如何设置模态框的返回值" class="mb-3">
<p> <code>ShowModal</code> <code>ShowModal&lt;TDialog&gt;</code> <code>TDialog</code> <code>IResultDialog</code> <code>SetResultAsync</code> </p>
<Pre>[CascadingParameter(Name = "ResultDialogContext")]
private Func&lt;DialogResult, Task&gt;? SetResultAsync { get; set; }
private async Task OnClick(DialogResult dialogResult)
{
if (SetResultAsync != null)
{
await SetResultAsync(dialogResult);
}
}</Pre>
<p></p>
<Pre>&lt;DialogCloseButton Color="@@ButtonNoColor" Icon="@@ButtonNoIcon" Text="@@ButtonNoText" OnClickWithoutRender="() => OnClick(DialogResult.No)" /></Pre>
<p> <code>DialogResult.No</code></p>
<p> <code>ResultDialogFooter</code> 使</p>
</GroupBox>
<GroupBox Title="代码中如何关闭弹窗" class="mb-3">
<p>使 <b></b> <b></b> <b></b> </p>

View File

@ -928,8 +928,9 @@ public class DateTimePickerTest : BootstrapBlazorTestBase
{
pb.Add(a => a.AutoClose, true);
});
button = cut.FindAll(".picker-panel-content .cell").First(i => i.TextContent == $"{DateTime.Today.Day}");
await cut.InvokeAsync(() => button.Click());
Assert.Equal(val, DateTime.MinValue);
Assert.NotEqual(val, DateTime.MinValue);
}
[Fact]