mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-05 13:37:35 +08:00
063e404af3
* feat(module: tree): add ChildContent for Tree and TreeNode Allow user set tree nodes directly. * fix indent
27 lines
731 B
C#
27 lines
731 B
C#
@namespace AntDesign
|
|
@inherits AntDomComponentBase
|
|
@typeparam TItem
|
|
|
|
<div class="@ClassMapper.Class" style="@Style" @ref="Ref">
|
|
<div class="ant-tree-list">
|
|
<div class="ant-tree-list-holder-inner">
|
|
<CascadingValue Value="this" Name="Tree" IsFixed="@true">
|
|
@if (DataSource != null)
|
|
{
|
|
foreach (var item in DataSource)
|
|
{
|
|
<TreeNode DataItem="@item" @key="item.GetHashCode()"></TreeNode>
|
|
}
|
|
}
|
|
else if (ChildContent!=null)
|
|
{
|
|
@ChildContent
|
|
}
|
|
else
|
|
{
|
|
@Nodes
|
|
}
|
|
</CascadingValue>
|
|
</div>
|
|
</div>
|
|
</div> |