Am使用Angular 6升级项目,其中angular2-tree组件少于500个节点(包括子节点)在google chrome浏览器中效果很好,但在Firefox中不起作用,这减慢了我尝试使用3个节点的浏览器选项卡,但它在firfox和Safari也是如此。
树选项是
options: ITreeOptions = {
idField: 'DTP_Mod_ID',
displayField: 'DTP_Mod_Name_TotalTC',
childrenField: 'children',
allowDrag: true,
allowDrop: true,
nodeHeight: 23,
useVirtualScroll: true
};
HTML树代码
<tree-root #tree [nodes]="nodes" [options]="options" (activate)="isActive($event.node.data)">
<ng-template #treeNodeTemplate let-node let-index="index" let-templates="templates">
<span class="fa fa-folder-o mr-2 font-small-3" *ngIf="node.isCollapsed && node.hasChildren"></span>
<span class="fa fa-folder-open-o mr-2 font-small-3" *ngIf="node.isExpanded && node.hasChildren"></span>
<span>{{ node.data.name }}</span>
</ng-template>
</tree-root>