ant-design-blazor/components/layout/Layout.razor
2020-05-29 00:33:49 +08:00

34 lines
610 B
C#

@namespace AntDesign
@inherits AntDomComponentBase
<CascadingValue Value="this">
<section class="@ClassMapper.Class" style="@Style" id="@Id">
@ChildContent
</section>
</CascadingValue>
@code
{
[Parameter]
public RenderFragment ChildContent { get; set; }
private bool _hasSider;
protected override void OnInitialized()
{
base.OnInitialized();
ClassMapper
.Add("ant-layout")
.If("ant-layout-has-sider", () => _hasSider);
}
internal void HasSider()
{
_hasSider = true;
StateHasChanged();
}
}