ant-design-blazor/components/tree/TreeNode.razor
琢磨先生 300123045f refactor(module: tree): add draggable, fix default value binding (#1517)
* delete demo docs

* fix tree default value and dnd

* fix tree line and keys

* fix switcher icon and line

* fix line demo

* fix switcher

* add DirectoryTree demo

* fix draggable demo

* clean code

* clean code

* clean up the classmapper call

* update docs

* fix the docs

* fix comment

Co-authored-by: James Yeung <shunjiey@hotmail.com>
2021-07-11 18:43:25 +08:00

39 lines
1010 B
C#

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