zoukankan      html  css  js  c++  java
  • 3、各种事件

    /* ---示例代码----*/
     
    <ion-content>
     
      <ion-card (tap)="tapEvent($event)">
        <ion-item>
          点击:Tap: {{tap}} times
        </ion-item>
      </ion-card>
     
      <ion-card (press)="pressEvent($event)">
        <ion-item>
          按:Press: {{press}} times
        </ion-item>
      </ion-card>
     
      <ion-card (pan)="panEvent($event)">
        <ion-item>
          平移:Pan: {{pan}} times
        </ion-item>
      </ion-card>
     
      <ion-card (swipe)="swipeEvent($event)">
        <ion-item>
          滑动:Swipe: {{swipe}} times
        </ion-item>
      </ion-card>
     
    </ion-content>
     
    /* ---示例代码----*/
    /* ---示例代码----*/
     
    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++
      }
       
    }
     
    /* ---示例代码----*/
    1、注意 pan 和 swipe 的区别 。   平移 与 滑动
        1、pan 是当我 按住 dom 左右滑动不松手。pan 累加
        2、而 swipe 是我 按住 dom 左右滑动松手之后 swipe 累加
     
    2、注意 tab 与  press 的区别 。 点击 与 按住
        1、tab  是 轻击 dom 触发方法
        2、press 则是按住 dom 500毫秒之后触发方法 如果这个时候你轻点一下dom 他将不会触发这个方法。
  • 相关阅读:
    php 类文件加载 Autoloader
    windows下配置nginx+php
    crontab 定时调度
    PHP 常见语法 集合
    php socket
    tengine + mysql + nginx + php
    yii2 [行为] behaviors 拦截器
    .htaccess 语法以及应用
    nginx 安装
    Nginx HTTP负载均衡和反向代理配置
  • 原文地址:https://www.cnblogs.com/dandingjun/p/5562547.html
Copyright © 2011-2022 走看看