我正在尝试使用[ngStyle]
设置悬停属性状态。
以下代码仅设置正常状态下的颜色。当我将鼠标悬停在按钮上时,该按钮不会按预期更改为按下颜色。
<button (click)="logout()"
class="btn register-button"
[ngStyle]=" hover ?
{'color': theme.logoutButtonColorPressed,
'border-color': theme.logoutButtonBorderColorPressed,
'background-color': theme.logoutButtonBackgroundColorPressed}:
{'color': theme.logoutButtonColorNormal,
'border-color': theme.logoutButtonBorderColorNormal,
'background-color': theme.logoutButtonBackgroundColorNormal}">
Logout
</button>
hover
是什么意思[ngStyle]=" hover {
? - Max Koretskyi<button (mouseover)="hover=true" (mouseleave)="hover=false"
... - Max Koretskyi- user2182570