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

26 lines
693 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>