如何在 Mat Chip 中编辑 Mat Ripples 属性 Angular

How to edit Mat Ripples properties in Mat Chip Angular

我正在开发一个 angular 应用程序,它在数据 table 中使用垫片。但是,来自 table 的数据存储在数据库中,并通过 HTTP 调用检索。因此,当我单击删除按钮时,波纹会一直延伸到 table 刷新并且它会变得非常大。

有没有办法修改垫片或其他 Angular Material 元素的波纹半径?我知道我可以禁用它,但最好修改半径。

我不确定它是什么时候引入的,但是从 Material 版本 6.4.7 开始,添加了 Ripples module 以更精细地控制波纹的行为方式,允许定义波纹半径、颜色等。使用这个新模块,您应该能够禁用每个组件上的本机波纹效果并用您自己的覆盖:

<mat-chip disableRipple matRipple matRippleRadius="10">One fish</mat-chip>

如果不禁用组件的原生波纹,每次点击都会产生两次波纹。