装饰器 @HostListener
@HostListener('mouseenter') onMouseEnter() {
this.highlight(this.hight||'red');
}
@HostListener('mouseleave') onMouseLeave() {
this.highlight(null);
}
private highlight(color: string) {
this.el.nativeElement.style.backgroundColor = color;
}
You can change the world with your heart,even a lot of changes sometimes unless you won't geiv up....