mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-11-29 18:48:50 +08:00
fix(module: tree): add ComponentBase (#956)
This commit is contained in:
parent
3582075e22
commit
9a5cbb9255
@ -1,4 +1,5 @@
|
||||
@namespace AntDesign
|
||||
@inherits ComponentBase
|
||||
@typeparam TItem
|
||||
|
||||
<span class="ant-tree-indent" aria-hidden="true">
|
||||
|
@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AntDesign
|
||||
{
|
||||
public partial class TreeIndent<TItem>
|
||||
public partial class TreeIndent<TItem> : ComponentBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 树控件本身
|
||||
@ -21,7 +21,5 @@ namespace AntDesign
|
||||
|
||||
[Parameter]
|
||||
public int TreeLevel { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
@if (RealDisplay)
|
||||
{
|
||||
<CascadingValue Value="this" Name="SelfNode">
|
||||
<div @key="NodeId" class="@TreeNodeClassMapper.Class">
|
||||
<div @key="NodeId" class="@ClassMapper.Class" style="@Style">
|
||||
|
||||
<TreeIndent TreeLevel="@TreeLevel" TItem="TItem"></TreeIndent>
|
||||
|
||||
@ -20,7 +20,6 @@
|
||||
}
|
||||
|
||||
<TreeNodeTitle TItem="TItem"></TreeNodeTitle>
|
||||
|
||||
</div>
|
||||
</CascadingValue>
|
||||
}
|
||||
@ -36,4 +35,4 @@
|
||||
{
|
||||
@Nodes
|
||||
}
|
||||
</CascadingValue>
|
||||
</CascadingValue>
|
@ -188,11 +188,9 @@ namespace AntDesign
|
||||
[Parameter]
|
||||
public bool Loading { get; set; }
|
||||
|
||||
protected ClassMapper TreeNodeClassMapper { get; } = new ClassMapper();
|
||||
|
||||
private void SetTreeNodeClassMapper()
|
||||
{
|
||||
TreeNodeClassMapper.Clear().Add("ant-tree-treenode")
|
||||
ClassMapper.Clear().Add("ant-tree-treenode")
|
||||
.If("ant-tree-treenode-disabled", () => Disabled)
|
||||
.If("ant-tree-treenode-switcher-open", () => SwitcherOpen)
|
||||
.If("ant-tree-treenode-switcher-close", () => SwitcherClose)
|
||||
|
@ -1,10 +1,8 @@
|
||||
@namespace AntDesign
|
||||
@inherits AntDomComponentBase
|
||||
@inherits ComponentBase
|
||||
@typeparam TItem
|
||||
|
||||
<span class="@ClassMapper.Class" @onclick="OnClick">
|
||||
<span class="ant-tree-checkbox-inner">
|
||||
|
||||
</span>
|
||||
|
||||
<span class="@ClassMapper.Class" @onclick="OnClick">
|
||||
<span class="ant-tree-checkbox-inner">
|
||||
</span>
|
||||
</span>
|
@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Components.Web;
|
||||
|
||||
namespace AntDesign
|
||||
{
|
||||
public partial class TreeNodeCheckbox<TItem> : AntDomComponentBase
|
||||
public partial class TreeNodeCheckbox<TItem> : ComponentBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 树控件本身
|
||||
|
@ -1,5 +1,5 @@
|
||||
@namespace AntDesign
|
||||
@inherits AntDomComponentBase
|
||||
@inherits ComponentBase
|
||||
@typeparam TItem
|
||||
|
||||
<span class="@ClassMapper.Class" @onclick="OnClick">
|
||||
|
@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Components.Web;
|
||||
|
||||
namespace AntDesign
|
||||
{
|
||||
public partial class TreeNodeSwitcher<TItem> : AntDomComponentBase
|
||||
public partial class TreeNodeSwitcher<TItem> : ComponentBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 树控件本身
|
||||
|
@ -1,5 +1,5 @@
|
||||
@namespace AntDesign
|
||||
@inherits AntDomComponentBase
|
||||
@inherits ComponentBase
|
||||
@typeparam TItem
|
||||
|
||||
<span class="@TitleClassMapper.Class" title="@SelfNode.Title" @onclick="OnClick" @ondblclick="OnDblClick" draggable="@CanDraggable" aria-grabbed="@CanDraggable">
|
||||
@ -33,5 +33,4 @@
|
||||
@SelfNode.Title
|
||||
</span>
|
||||
}
|
||||
</span>
|
||||
|
||||
</span>
|
@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Components.Web;
|
||||
|
||||
namespace AntDesign
|
||||
{
|
||||
public partial class TreeNodeTitle<TItem> : AntDomComponentBase
|
||||
public partial class TreeNodeTitle<TItem> : ComponentBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 树控件本身
|
||||
|
Loading…
Reference in New Issue
Block a user