ant-design-blazor/components/spin/Spin.razor
2020-05-29 00:33:49 +08:00

53 lines
1.4 KiB
C#

@namespace AntDesign
@inherits AntDomComponentBase
@if (Simple)
{
@simpleTemplate(this)
}
else
{
<div class="@WrapperClassMapper.Class">
<div>
@simpleTemplate(this)
</div>
</div>
}
@code{
RenderFragment defaultTemplate =
@<span class="ant-spin-dot ant-spin-dot-spin">
<i class="ant-spin-dot-item"></i>
<i class="ant-spin-dot-item"></i>
<i class="ant-spin-dot-item"></i>
<i class="ant-spin-dot-item"></i>
</span>;
RenderFragment<Spin> simpleTemplate = spin=>
@<Template>
@if (spin._isLoading)
{
<div class="@spin.ClassMapper.Class" id="@spin.Id" style="@spin.Style" @ref="spin.Ref">
@if (spin.Indicator != null)
{
@spin.Indicator
}
else
{
@spin.defaultTemplate
}
@if (spin.Tip != null)
{
<div class="ant-spin-text">@spin.Tip</div>
}
</div>
}
@if (!spin.Simple)
{
<div class="ant-spin-container @spin.ContainerClass">
@spin.ChildContent
</div>
}
</Template>;
}