我有一张带有“x”按钮的有角材料卡。
只是希望“x”按钮正常隐藏并在悬停在卡片上时显示。
卡的代码:
<mat-card>
<mat-card-title>hello title</mat-card-title>
<mat-card-content>hello content</mat-card-content>
<mat-card-actions>
<button mat-icon-button><mat-icon>close</mat-icon></button>
</mat-card-actions>
</mat-card>
Run Code Online (Sandbox Code Playgroud)
想过使用ngClass但不知道如何判断用户是否悬停