ant-design-blazor/components/badge/Badge.razor
TimChen cbc5e823f0 refactor(module: all): separate the normal and template parameters (#552)
* fix: card title template

* fix: template:badge,collapse

* fix: comment refactor template

* fix: ribbonTests

* feat: descriptions refactor template

* feat: empty refactor template

* feat: list refactor template

* feat: menu refactor template

* feat: confirm add question icon

* feat: pageHeader and statistic refactor template

* feat: popconfirm refactor template

* feat: popver refactor template

* feat: result refactor template

* feat: step refactor template

* feat: switch refactor template

* feat: table refactor template

* feat: transfer refactor template

* feat: optimized code

* fix: pageheader

* refactor(module: empty): remove empty image constant images

Co-authored-by: ElderJames <shunjiey@hotmail.com>
2020-09-16 13:58:16 +08:00

61 lines
2.0 KiB
C#

@namespace AntDesign
@inherits AntDomComponentBase
<span class="@ClassMapper.Class" @ref="Ref" id="@Id">
@if (ChildContent != null)
{
@ChildContent
}
@if (HasStatusOrColor)
{
<span class="@($"ant-badge-status-dot {(StatusOrPresetColor!=null? $"ant-badge-status-{StatusOrPresetColor}":"")}")" style="@(PresetColor == null && string.IsNullOrWhiteSpace(Color)?$"background:{Color};":"") @Style"></span>
@if (!string.IsNullOrEmpty(Text))
{
<span class="ant-badge-status-text">@Text</span>
}
}
@if (CountTemplate != null)
{
<span role="img" class="ant-scroll-number-custom-component">@CountTemplate</span>
}
else
{
@if (!string.IsNullOrEmpty(Text))
{
<span class="ant-badge-status-text">@Text</span>
}
if (_showSup)
{
<sup class="@CountClassMapper.Class" style="@CountStyle @Style" title="@Count">
@if (!Dot)
{
@if (Count <= OverflowCount)
{
@for (int i = 0; i < _maxNumberArray.Length; i++)
{
@if (_countArray.Length > i)
{
<span class="ant-scroll-number-only" style="transform: @($"translateY(-{_countArray[i] * 100}%)")">
@foreach (var p in _countSingleArray)
{
<p class="ant-scroll-number-only-unit @(p == _countArray[i] ? "current" : "")">
@p
</p>
}
</span>
}
}
}
else
{
@($"{OverflowCount}+")
}
}
</sup>
}
}
</span>