ant-design-blazor/components/tree/TreeNode.razor
TimChen 542b66d383 refactor: tree (#672)
* feat: refactor tree

* feat: refactor tree

Co-authored-by: James Yeung <shunjiey@hotmail.com>
2020-10-09 15:13:32 +08:00

39 lines
907 B
C#

@namespace AntDesign
@inherits AntDomComponentBase
@if (IsRealDisplay)
{
<CascadingValue Value="this" Name="SelfNode">
<div @key="NodeId" class="@TreeNodeClassMapper.Class">
<TreeIndent TreeLevel="@TreeLevel"></TreeIndent>
@if (TreeComponent.ShowExpand)
{
<TreeNodeSwitcher OnSwitcherClick="OnSwitcherClick"></TreeNodeSwitcher>
}
@if (TreeComponent.Checkable)
{
<TreeNodeCheckbox OnCheckBoxClick="OnCheckBoxClick"></TreeNodeCheckbox>
}
<TreeNodeTitle></TreeNodeTitle>
</div>
</CascadingValue>
}
<CascadingValue Value="this" Name="Node">
@if (DataItem != null)
{
foreach (var item in ChildDataItems)
{
<TreeNode DataItem="@item"></TreeNode>
}
}
else
{
@Nodes
}
</CascadingValue>