import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-view-change-demo', templateUrl: './view-change-demo.component.html', styleUrls: ['./view-change-demo.component.scss'] }) export class ViewChangeDemoComponent implements OnInit { toolbarIconData = [ { type: 'type1', url:'list-grid', title:'卡片视图', iconName:'k-icon k-i-calendar-date' }, { type: 'type2', url:'list-echart', title:'图表视图', iconName:'k-icon k-i-star-outline' }, { type: 'type3', url:'list-view', title:'列表视图', iconName:'k-icon k-i-columns' }, { type: 'type4', url:'list-card', title:'日历视图', iconName:'k-icon k-i-bookmark' } ] currentType1 = 'type2'; constructor() { } ngOnInit() { } toolTypeChange(event){ this.currentType1 = event.type; } }