gpt4 book ai didi

javascript - Angular Material - 为树添加分支线?

转载 作者:太空狗 更新时间:2023-10-29 15:39:39 24 4
gpt4 key购买 nike

我用 Angular material tree 创建了一个简单的树:

https://stackblitz.com/edit/angular-exhejg-vx5i7c?file=app/tree-dynamic-example.html

<mat-tree [dataSource]="dataSource" [treeControl]="treeControl" >
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding >
<button mat-icon-button ></button>
{{node.item}}
</mat-tree-node>


<mat-tree-node *matTreeNodeDef="let node; when: hasChild" matTreeNodePadding >
<button mat-icon-button
[attr.aria-label]="'toggle ' + node.filename" matTreeNodeToggle>
<mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</button>
{{node.item + '2'}}
<mat-progress-bar *ngIf="node.isLoading"
mode="indeterminate"
class="example-tree-progress-bar"></mat-progress-bar>
</mat-tree-node>


</mat-tree>

看起来像:

enter image description here

但是如何添加支线呢?类似的东西(来自 here ):

enter image description here

最佳答案

没有开箱即用的此类功能。但是您可以通过 CSS 应用它。有一个 working example

关于javascript - Angular Material - 为树添加分支线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52202100/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com