ant-design-blazor/components/list/AntListItemMeta.razor
James Yeung d16144ece0 refactor: remove the 'ant' prefix for some components that is already in demos (#162)
* refactor: button

* refactor: avatar

* refactor: alert

* fix: input group compact
2020-05-29 12:55:15 +08:00

58 lines
1.3 KiB
C#

@namespace AntDesign
@inherits AntDomComponentBase
<div class="@ClassMapper.Class" style="@Style">
@if (Avatar.IsT0 && Avatar.AsT0 != "")
{
<div class="ant-list-item-meta-avatar">
<Avatar Src="@Avatar.AsT0"></Avatar>
</div>
}
@if (Avatar.IsT1 && Avatar.AsT1 != null)
{
<div class="ant-list-item-meta-avatar">
@Avatar.AsT1
</div>
}
<div class="ant-list-item-meta-content">
<div>
<h4 class="ant-list-item-meta-title">
@Title
</h4>
</div>
<div class="ant-list-item-meta-description">
@Description
</div>
</div>
</div>
@code{
public string PrefixName { get; set; } = "ant-list-item-meta";
[Parameter] public RenderFragment Title { get; set; }
[Parameter] public OneOf.OneOf<string, RenderFragment> Avatar { get; set; }
[Parameter] public string Description { get; set; }
protected override void OnInitialized()
{
base.OnInitialized();
SetClassMap();
}
protected override void OnParametersSet()
{
base.OnParametersSet();
SetClassMap();
}
protected void SetClassMap()
{
ClassMapper.Clear()
.Add(PrefixName);
}
}