ant-design-blazor/components/switch/Switch.razor
Henry.zhang ab19703301 refactor: demos of icon, steps , tabs (#199)
* refactor: remove md of tabs demo

* feat: add demos of steps

* refactor: tabs demo

* fix: icon

* refactor: tag

Co-authored-by: ElderJames <shunjiey@hotmail.com>
2020-06-10 21:44:21 +08:00

53 lines
1.2 KiB
C#

@namespace AntDesign
@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)
{
<Icon Type="loading" Class="@($"{_prefixCls}-loading-icon")" />
}
<div class="@($"{_prefixCls}-handle")"></div>
<span class="@($"{_prefixCls}-inner")">
@if (_isChecked)
{
if (CheckedChildren.IsT0)
{
@(CheckedChildren.AsT0)
}
else
{
@(CheckedChildren.AsT1)
}
}
else
{
if (UnCheckedChildren.IsT0)
{
@(UnCheckedChildren.AsT0)
}
else
{
@(UnCheckedChildren.AsT1)
}
}
</span>
<!--animation-->
@if (_isChecked)
{
<div class="ant-click-animating-node"></div>
}
else
{
<div class="ant-click-animating-node"></div>
}
</button>