mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-05 21:47:38 +08:00
ef4701b6ed
* refactor(module: modal): refactor the code of Modal, Confirm and Dialog refactor details: - Add DialogWrapper compontent to control the logic of dialog removal from DOM - Add the appropriate folders for Dialog, Modal, and Confirm - Remove methods with the same logic but different names in ConfirmService - Split Title into Title (string) and Titletemplate (renderfragment) - Add comments to code - Rename ConfirmDialog to Confirm - Specification of method name in ConfirmService - Adjust the time of throttle function for draggabe modal - Extract the common part of ModalOptions, ConfirmOptions and DialogOptions as DialogOptionsBase * refactor: move DefaultCloseIcon etc. static members to DialogOptionsBase * docs(module: modal): update docs * fix: dialog incorrect waiting * fix: pickup missing pr/7
58 lines
1.6 KiB
C#
58 lines
1.6 KiB
C#
@namespace AntDesign
|
|
@inherits AntDomComponentBase
|
|
|
|
@{
|
|
var okProps = ModalProps.OkButtonProps ?? new ButtonProps();
|
|
okProps.Type = ModalProps.OkType;
|
|
okProps.Loading = ModalProps.ConfirmLoading;
|
|
|
|
var cancelProps = ModalProps.CancelButtonProps ?? new ButtonProps();
|
|
}
|
|
|
|
<div>
|
|
<Button OnClick="@HandleOk"
|
|
Loading="@okProps.Loading"
|
|
Type="@okProps.Type"
|
|
Block="@okProps.Block"
|
|
Ghost="@okProps.Ghost"
|
|
Search="@okProps.Search"
|
|
Shape="@okProps.Shape"
|
|
Size="@okProps.Size"
|
|
Icon="@okProps.Icon"
|
|
Disabled="@okProps.Disabled"
|
|
Danger="@okProps.IsDanger">
|
|
@{
|
|
if (ModalProps.OkText.IsT0)
|
|
{
|
|
@(ModalProps.OkText.AsT0)
|
|
}
|
|
else
|
|
{
|
|
@(ModalProps.OkText.AsT1)
|
|
}
|
|
}
|
|
</Button>
|
|
<Button OnClick="@HandleCancel"
|
|
Block="@cancelProps.Block"
|
|
Ghost="@cancelProps.Ghost"
|
|
Search="@cancelProps.Search"
|
|
Loading="@cancelProps.Loading"
|
|
Type="@cancelProps.Type"
|
|
Shape="@cancelProps.Shape"
|
|
Size="@cancelProps.Size"
|
|
Icon="@cancelProps.Icon"
|
|
Disabled="@cancelProps.Disabled"
|
|
Danger="@cancelProps.IsDanger">
|
|
@{
|
|
if (ModalProps.CancelText.IsT0)
|
|
{
|
|
@(ModalProps.CancelText.AsT0)
|
|
}
|
|
else
|
|
{
|
|
@(ModalProps.CancelText.AsT1)
|
|
}
|
|
}
|
|
</Button>
|
|
</div>
|