2020-05-29 00:33:49 +08:00
|
|
|
@namespace AntDesign
|
2019-12-08 00:51:07 +08:00
|
|
|
@inherits AntDomComponentBase
|
|
|
|
|
2019-12-16 18:47:23 +08:00
|
|
|
|
2021-01-21 17:20:10 +08:00
|
|
|
<CascadingValue Value="this" IsFixed="@true">
|
2020-04-23 17:13:56 +08:00
|
|
|
<section class="@ClassMapper.Class" style="@Style" id="@Id">
|
2019-12-16 18:47:23 +08:00
|
|
|
@ChildContent
|
2020-03-12 14:34:01 +08:00
|
|
|
</section>
|
2019-12-16 18:47:23 +08:00
|
|
|
</CascadingValue>
|
2019-12-08 00:51:07 +08:00
|
|
|
|
|
|
|
@code
|
|
|
|
{
|
|
|
|
[Parameter]
|
|
|
|
public RenderFragment ChildContent { get; set; }
|
|
|
|
|
2020-05-10 15:42:02 +08:00
|
|
|
private bool _hasSider;
|
2019-12-08 00:51:07 +08:00
|
|
|
|
2019-12-16 18:47:23 +08:00
|
|
|
|
|
|
|
protected override void OnInitialized()
|
2019-12-08 00:51:07 +08:00
|
|
|
{
|
2019-12-16 18:47:23 +08:00
|
|
|
base.OnInitialized();
|
2019-12-08 00:51:07 +08:00
|
|
|
ClassMapper
|
|
|
|
.Add("ant-layout")
|
2021-03-12 17:02:11 +08:00
|
|
|
.If("ant-layout-has-sider", () => _hasSider)
|
|
|
|
.If("ant-layout-rtl", () => RTL);
|
2020-05-10 15:42:02 +08:00
|
|
|
}
|
|
|
|
|
2020-05-22 00:05:26 +08:00
|
|
|
internal void HasSider()
|
2020-05-10 15:42:02 +08:00
|
|
|
{
|
|
|
|
_hasSider = true;
|
2020-05-22 00:05:26 +08:00
|
|
|
StateHasChanged();
|
2019-12-08 00:51:07 +08:00
|
|
|
}
|
|
|
|
|
2019-12-16 18:47:23 +08:00
|
|
|
}
|