import { Component, OnInit, ViewChild } from '@angular/core'; import { data as treeData } from '../../treetable-demo.data'; import { TreeTableComponent } from '@farris/ui-treetable'; @Component({ selector: 'demo-treetable-basic', templateUrl: 'demo-treetable-basic.component.html' }) export class DemoTreetableBasicComponent implements OnInit { treedata = treeData.data; 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}, { field: 'addr.city', title: '城市', width: 100, isMultilingualField: true}, { field: 'duoyu', title: '多语字段', width: 100, isMultilingualField: true}, ]; } updateTreeicon() { this.tt.expandIcon = 'expand-icon'; this.tt.collapseIcon = 'collapse-icon'; this.tt.leafIcon = 'leaf-icon'; this.tt.detectChanges(); } }