ant-design-blazor/components/modal/ModalFooter.razor
zxyao 6db07ad916 feat: add component modal (#167)
* feat: add component modal

* fix: adjust namespace and fix TAB keyboard bug

* fix: reset package.json to cuueernt head

* fix: remove antblazor.sln

* refactor: using c# to control the display and hiding of modal
2020-06-02 14:25:44 +08:00

63 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="@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.Danger"
>
@{
if (ModalProps.CancelText.IsT0)
{
@(ModalProps.CancelText.AsT0)
}
else
{
@(ModalProps.CancelText.AsT1)
}
}
</Button>
<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.Danger"
>
@{
if (ModalProps.OkText.IsT0)
{
@(ModalProps.OkText.AsT0)
}
else
{
@(ModalProps.OkText.AsT1)
}
}
</Button>
</div>