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

问题描述

我希望将离子按钮的状态设置为活动,但这在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;

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

07-22 16:13