Ionic 2 range touchend 事件 [英] Ionic 2 range touchend event

查看:14
本文介绍了Ionic 2 range touchend 事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在输入末尾使用 Ionic 2 获取范围滑块的值.

I´m trying to get the value of a range slider with Ionic 2 at the end of an input.

文档中唯一可用的event是ionChange,在输入过程中会触发几次,我只需要最后一个值来执行动作.

In the doumentation the only availible event is the ionChange, which triggers several times during an input, and I only need the last value to perform an action.

我尝试手动添加 touchend 事件,但该事件被忽略.

I tried to add the touchend event manually but the event is ignored.

这也是一个 Plunker 的问题.

Here´s also a Plunker with the Problem.

<ion-range (ionChange)="showVal($event)" (touchend)="presentValue(event)" min="0" max="100" [(ngModel)]="currentTime" color="danger">
          <ion-icon small range-left name="sunny"></ion-icon>
          <ion-icon range-right name="sunny"></ion-icon>
     </ion-range>

有人知道在 Ionic 2 的范围滑块上收听 touchend 事件的方法吗?

Does anybody know a way to listen to an touchend event on the range slider in Ionic 2?

推荐答案

还有 ionBlurionFocus 事件可以用于范围输入.

There is also the ionBlur and ionFocus event on the range input you could use.

ionFocus 在您滑过范围时触发ionBlur 在您释放范围项时触发

The ionFocus fires when you are sliding through the range and the ionBlur is fired when you have released the range item

<ion-range (ionBlur)="rangeBlurred($event)" (ionFocus)="rangeFocused($event)">

这篇关于Ionic 2 range touchend 事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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