2020-04-24 18:32:50 +08:00
|
|
|
|
using Microsoft.AspNetCore.Components;
|
2019-12-08 00:51:07 +08:00
|
|
|
|
using Microsoft.AspNetCore.Components.CompilerServices;
|
|
|
|
|
using Microsoft.AspNetCore.Components.Rendering;
|
|
|
|
|
|
2020-05-29 00:33:49 +08:00
|
|
|
|
namespace AntDesign
|
2019-12-08 00:51:07 +08:00
|
|
|
|
{
|
|
|
|
|
public abstract class AntContainerComponentBase : AntDomComponentBase
|
|
|
|
|
{
|
|
|
|
|
[Parameter]
|
|
|
|
|
public RenderFragment ChildContent { get; set; }
|
|
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
|
public string Tag { get; set; } = "div";
|
|
|
|
|
|
|
|
|
|
protected override void BuildRenderTree(RenderTreeBuilder builder)
|
|
|
|
|
{
|
2020-04-24 18:32:50 +08:00
|
|
|
|
if (builder != null)
|
|
|
|
|
{
|
|
|
|
|
builder.OpenElement(0, Tag);
|
|
|
|
|
builder.AddAttribute(1, "class", ClassMapper.Class);
|
|
|
|
|
builder.AddAttribute(2, "style", GenerateStyle());
|
|
|
|
|
builder.AddAttribute(4, "id", Id);
|
|
|
|
|
builder.AddElementReferenceCapture(5, (value) => { Ref = value; });
|
|
|
|
|
builder.AddContent(7, ChildContent);
|
|
|
|
|
builder.CloseElement();
|
|
|
|
|
}
|
2019-12-08 00:51:07 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2020-04-23 17:13:56 +08:00
|
|
|
|
}
|