import { Component, OnInit } from '@angular/core'; @Component({ selector: 'farris-doc-button', templateUrl: './button.component.html', styleUrls: ['./button.component.scss'] }) export class ButtonComponent implements OnInit { data = [ { id: 'b1', text: '增加', type: 'primary' }, { id: 'b2', text: '删除', type: 'warning' }, { id: 'b3', text: '保存', type: 'success' }, { id: 'b4', text: '编辑' } ]; ngOnInit() { } changeEvent(value: string) { console.log(value); } }