ant-design-blazor/components/avatar/Avatar.razor

26 lines
697 B
C#
Raw Normal View History

@namespace AntDesign
@inherits AntDomComponentBase
2019-12-17 17:53:25 +08:00
<span class="@ClassMapper.Class" style="@Style" id="@Id" @ref="Ref">
@if (!string.IsNullOrEmpty(Icon) && _hasIcon)
2019-12-17 17:53:25 +08:00
{
<Icon Type="@Icon" />
2019-12-17 17:53:25 +08:00
}
@if (!string.IsNullOrEmpty(Src) && _hasSrc)
2019-12-17 17:53:25 +08:00
{
<img src="@Src" srcset="@SrcSet" alt="@Alt" @onerror="ImgError" />
2019-12-17 17:53:25 +08:00
}
@if (!string.IsNullOrEmpty(_text) && _hasText)
2019-12-17 17:53:25 +08:00
{
<span class="ant-avatar-string" @ref="TextEl" style="@_textStyles">
@_text
2019-12-17 17:53:25 +08:00
</span>
}
else if (_childContent != null)
{
<span class="ant-avatar-string" @ref="TextEl" style="@_textStyles">
@_childContent
</span>
}
</span>