ant-design-blazor/components/layout/Sider.razor
James Yeung 90690fba01 docs: add some of layout demos (#138)
* feat: add layout demo

* feat: add some of layout demos
2020-05-22 00:05:26 +08:00

51 lines
1.2 KiB
C#

@namespace AntBlazor
@inherits AntDomComponentBase
<CascadingValue Value="this">
<aside class="@ClassMapper.Class" @ref="Ref" style="@InternalStyle @Style" id="@Id">
@if (IsZeroTrigger)
{
<span class="ant-layout-sider-zero-width-trigger" @onclick="ToggleCollapse">
@if (ZeroTrigger != null)
{
@ZeroTrigger
}
else
{
<AntIcon Type="bars"></AntIcon>
}
</span>
}
<div class="ant-layout-sider-children">
@ChildContent
</div>
@if (IsSiderTrigger)
{
<div class="ant-layout-sider-trigger"
@onclick="ToggleCollapse"
style="width: @WidthSetting">
@SiderTrigger
</div>
}
</aside>
</CascadingValue>
@code {
private RenderFragment<Sider> defaultTrigger = (sider) =>
@<Template>
@if (!sider.ReverseArrow)
{
<AntIcon Type="@(sider.Collapsed ? "right" : "left")"></AntIcon>
}
else
{
<AntIcon Type="@(sider.Collapsed ? "left" : "right")"></AntIcon>
}
</Template>;
}