import { Component, OnInit, ViewChild } from '@angular/core'; import { TreeTableComponent } from '@farris/ui-treetable'; @Component({ selector: 'demo-treetable-empty-data', templateUrl: './demo-empty-data.component.html' }) export class DemoTreetableEmptyDataComponent implements OnInit { treedata = []; cols = []; showIcon = true; @ViewChild('tt') tt: TreeTableComponent; constructor() { } ngOnInit() { this.cols = [ { field: 'name', title: 'Name', width: 200}, { field: 'size', title: 'Size', width: 100 }, { field: 'type', title: 'Type', width: 100}, { field: 'single', title: '单身', width: 100}, { field: 'age', title: '年龄', width: 100}, { field: 'birthday', title: '日期', width: 100}, { field: 'photo', title: '头像', width: 100}, { field: 'xueli', title: '学历', width: 100} ]; } updateTreeicon() { this.tt.expandIcon = 'expand-icon'; this.tt.collapseIcon = 'collapse-icon'; this.tt.leafIcon = 'leaf-icon'; this.tt.detectChanges(); } }