ant-design-blazor/components/spin/Spin.razor

53 lines
1.4 KiB
C#
Raw Normal View History

@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>;
}