/ *---Sample code----* /<ion-content> <Ion-card(TAP)= "Tapevent ($event)"> <Ion-item>click: Tap: {{tap}} times</Ion-item> </Ion-card> <Ion-card(Press)= "Pressevent ($event)"> <Ion-item>by: Press: {{press}} times</Ion-item> </Ion-card> <Ion-card(PAN)= "Panevent ($event)"> <Ion-item>pan: Pan: {{Pan}} times</Ion-item> </Ion-card> <Ion-card(swipe)= "Swipeevent ($event)"> <Ion-item>Swipe: Swipe: {{Swipe}} times</Ion-item> </Ion-card> </ion-content>/ *---Sample code----* /
/*---The sample code----*/Import {Page} from' Ionic-angular '; @Page ({templateurl:' Build/pages/tabs/tabs.html '}) Export class Tabspage {constructor () { This. Press = 0; This. Pan = 0; This. Swipe =0; This. Tap = 0; } pressevent (e) { This. press++} panevent (e) { This. pan++} swipeevent (e) { This. swipe++} tapevent (e) { This. tap++ } } /*---The sample code----*/
1. Attention
PanAnd
SwipeThe difference.
panning and sliding
1.Pan is when I hold the DOM and swipe left or right. Pan accumulation
2, and swipe is I hold the DOM left and right, after swipe accumulation
2. Attention
TabAnd
PressThe difference.
Tap and hold
1. tab is the way to tap the DOM trigger
2, Press is to hold the DOM after 500 milliseconds trigger method if this time you tap the DOM he will not trigger this method.
3. Various events