Ionic 2系列touchend活动 [英] Ionic 2 range touchend event
问题描述
我试图在输入结束时获取Ionic 2的范围滑块的值。
在 doumentation 唯一可用的事件是ionChange,它在输入过程中会多次触发,我只需要最后一个值来执行操作。
<我尝试手动添加touchend事件,但忽略了该事件。
这里还有 Plunker 有问题。
< ion-range(ionChange)=showVal($ event)(touchend) =presentValue(event)min =0max =100[(ngModel)] =currentTimecolor =danger>
< ion-icon small range-left name =sunny>< / ion-icon>
< ion-icon range-right name =sunny>< / ion-icon>
< / ion-range>
有人知道在Ionic 2的范围滑块上收听touchend事件的方法吗?
还有 ionBlur
和您可以使用的范围输入上的ionFocus
事件。
当您启动 ionFocus
时会触发你已经释放了范围项目时会触发
范围内的 ionBlur
。
< ion-range(ionBlur)=rangeBlurred($ event)(ionFocus)=rangeFocused($ event)>
I´m trying to get the value of a range slider with Ionic 2 at the end of an input.
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.
I tried to add the touchend event manually but the event is ignored.
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>
Does anybody know a way to listen to an touchend event on the range slider in Ionic 2?
There is also the ionBlur
and ionFocus
event on the range input you could use.
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系列touchend活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!