NgxRipple
Installation
npm i 2yy-ngx-ripple
Motivation
默认情况下,涟漪< /code> a> 由点击事件触发。
但是,如果你想通过 mouseenter 事件触发 Ripples,你可以使用 NgxRippleService
来实现。
Usage
在你的 foo.component.ts
中:
@ViewChild('btn', {read: MatRipple}) btnRef: MatRipple;
constructor(public rippleService: NgxRippleService) {}
然后,在你的 foo.component.html
中:
License
MIT 许可证
NgxRipple
Installation
npm i 2yy-ngx-ripple
Motivation
By default, Ripples triggered by click event.
But, if you want trigger Ripples by mouseenter event, you can achieve it with NgxRippleService
.
Usage
In your foo.component.ts
:
@ViewChild('btn', {read: MatRipple}) btnRef: MatRipple;
constructor(public rippleService: NgxRippleService) {}
Then, in your foo.component.html
:
<button #btn matRipple (mouseenter)="rippleService.show(btnRef)" (mouseleave)="rippleService.hide(btnRef)">My Button</button>
License
MIT License