3. Various events

Source: Internet
Author: User
Tags export class

/ *---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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.