离子按钮激活/激活 [英] ionic button activated / active

查看:23
本文介绍了离子按钮激活/激活的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望将离子按钮的状态设置为活动状态,但 API 文档中根本没有记录.截至目前,当您单击按钮时,激活"类被添加到按钮中,然后在片刻之后被删除.

I am looking to set an ionic button's state to active, but this isn't documented at all in the API docs. As of right now, when you click the button, the "activated" class is added to the button, and then removed a few moments later.

推荐答案

这可以通过 [ngClass]="{'activated' : YourVariableHere }"

HTML:

<button class="post-button" [ngClass]="{'activated' : buttonActive}"ion-button outline small icon-left">

组件代码:

buttonActive: boolean = true;

这篇关于离子按钮激活/激活的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆