mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-15 09:21:24 +08:00
542b66d383
* feat: refactor tree * feat: refactor tree Co-authored-by: James Yeung <shunjiey@hotmail.com>
39 lines
907 B
C#
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>
|