import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; @Component({ selector: 'rh-function-button', templateUrl: './function-button.component.html', styleUrls: ['./function-button.component.less'] }) export class RhFunctionButtonComponent implements OnInit { /** iconType */ @Input() rhIcon = 'file-search'; /** 功能名称 */ @Input() rhFunctionName = ''; /** 禁用 */ @Input() rhDisabled = false; /** 是否特殊样式 */ @Input() rhIsSpecialStyle = false; /** 按钮是否选中,具有特定的样式 */ @Input() rhSelect = false; @Output() rhSelectChange = new EventEmitter(); /** 点击事件 */ @Output() rhClickButton = new EventEmitter(); constructor() { // } ngOnInit(): void { // } clickButton() { if (this.rhDisabled) { return; } this.rhSelect = !this.rhSelect; this.rhClickButton.emit(this.rhSelect); this.rhSelectChange.emit(this.rhSelect); } }