2020-05-29 00:33:49 +08:00
|
|
|
|
@namespace AntDesign
|
2020-06-07 00:47:18 +08:00
|
|
|
|
@inherits AntInputComponentBase<bool>
|
|
|
|
|
|
|
|
|
|
<button type="button" role="switch"
|
|
|
|
|
aria-checked="@(_isChecked?"true":"false")"
|
|
|
|
|
disabled="@Disabled"
|
|
|
|
|
class="@ClassMapper.Class"
|
|
|
|
|
style="@Style"
|
|
|
|
|
ant-click-animating="@(_clickAnimating?"true":"false")"
|
|
|
|
|
@onmouseover="HandleMouseOver"
|
|
|
|
|
@onmouseout="HandleMouseOut"
|
|
|
|
|
@onclick="HandleClick">
|
|
|
|
|
@if (Loading)
|
|
|
|
|
{
|
2020-06-10 21:44:21 +08:00
|
|
|
|
<Icon Type="loading" Class="@($"{_prefixCls}-loading-icon")" />
|
2020-06-07 00:47:18 +08:00
|
|
|
|
}
|
|
|
|
|
<div class="@($"{_prefixCls}-handle")"></div>
|
|
|
|
|
<span class="@($"{_prefixCls}-inner")">
|
|
|
|
|
@if (_isChecked)
|
2020-05-18 14:46:42 +08:00
|
|
|
|
{
|
2020-06-07 00:47:18 +08:00
|
|
|
|
if (CheckedChildren.IsT0)
|
2020-05-18 14:46:42 +08:00
|
|
|
|
{
|
2020-06-07 00:47:18 +08:00
|
|
|
|
@(CheckedChildren.AsT0)
|
2020-05-18 14:46:42 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-06-07 00:47:18 +08:00
|
|
|
|
@(CheckedChildren.AsT1)
|
2020-05-18 14:46:42 +08:00
|
|
|
|
}
|
2020-05-28 16:56:52 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-06-07 00:47:18 +08:00
|
|
|
|
if (UnCheckedChildren.IsT0)
|
|
|
|
|
{
|
|
|
|
|
@(UnCheckedChildren.AsT0)
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
@(UnCheckedChildren.AsT1)
|
|
|
|
|
}
|
2020-03-12 18:23:00 +08:00
|
|
|
|
}
|
2020-06-07 00:47:18 +08:00
|
|
|
|
</span>
|
2020-03-12 18:23:00 +08:00
|
|
|
|
|
2020-06-07 00:47:18 +08:00
|
|
|
|
<!--animation-->
|
|
|
|
|
@if (_isChecked)
|
2020-05-28 16:56:52 +08:00
|
|
|
|
{
|
2020-06-07 00:47:18 +08:00
|
|
|
|
<div class="ant-click-animating-node"></div>
|
2020-05-28 16:56:52 +08:00
|
|
|
|
}
|
2020-06-07 00:47:18 +08:00
|
|
|
|
else
|
2020-05-28 16:56:52 +08:00
|
|
|
|
{
|
2020-06-07 00:47:18 +08:00
|
|
|
|
<div class="ant-click-animating-node"></div>
|
2020-05-28 16:56:52 +08:00
|
|
|
|
}
|
2020-06-07 00:47:18 +08:00
|
|
|
|
</button>
|