ionic2 tap vs click

前端 未结 6 1904
隐瞒了意图╮
隐瞒了意图╮ 2020-12-09 17:02

I am starting with angular2 and ionic2;

In ionic2, I have a button that will call a method of my component. Like this:

6条回答
  •  一整个雨季
    2020-12-09 17:09

    If making mobile apps, (tap) might be better. This is because when using (click) the action always executes, even when tapping accidently. The (tap) won't execute if the user holds it for a longer period. And if you want to have a button that needs to be clicked for a longer period of time you can use the (press).

    Note that in some ionic versions the (click) event won't execute on iOS. Therefore using (tap) would be the recommended solution.

提交回复
热议问题