zoukankan      html  css  js  c++  java
  • uni-app 事件以及事件绑定

    事件修饰符
    stop的使用会阻止冒泡,但是同时绑定了一个非冒泡的事件,会导致该元素上的catchEventName失效!

    prevent可以直接干掉,因为uni-app里没有什么默认事件,比如submit并不会跳转页面。

    self没有可以判断的标识

    once也不能做,因为uni-app没有removeEventListener,虽然可以直接在handleProxy中处理,但非常的不优雅,违背了愿意,暂不考虑按键修饰符:uni-app运行在手机端,没有键盘事件,所以不支持按键修饰符。

    view
    视图容器

    hover-class
    类型为string,默认值none
    指定按下去的样式类,类hover-class="none"时,没有点击态效果

    hover-stop-propagation
    类型boolean,默认值false
    指定是否阻止本节点的祖先节点出现点击态

    hover-start-time
    类型number,默认值50
    按住后多久出现点击态

    hover-stay-time
    类型number,默认值400
    手指松开后点击态保留时间

    <picker :range="years" @change="yearChange" mode="multiSelector">
     <view>
      {{years[0] [yearIndex1]}} {{years[1][yearIndex2]}}
     </view>
    </picker>
    

    file

    <swiper :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration">
    </swiper>
    
    <view class="demo" @click="clickTest" @longtap="longtap"></view>
    
    methods:{
      clickTest: function(e){
       console.log(e);
       console.log('click');
      },
      longtap: function(e){
       console.log(e);
       console.log('longtap');
      }
     }
    
    <view v-for="(item, index) in students" class="persons" @click="menuClick" v-bind:id="index">{{index}} - {{item.name}}</view>
    
    methods:{
     menuClick : function(e){
      console.log(e);
      console.log(e.target.id);
     }
     },
    

    stop 的使用会阻止冒泡


    若本号内容有做得不到位的地方(比如:涉及版权或其他问题),请及时联系我们进行整改即可,会在第一时间进行处理。


    请点赞!因为你们的赞同/鼓励是我写作的最大动力!

    欢迎关注达达的简书!

    这是一个有质量,有态度的博客

    博客

  • 相关阅读:
    wget
    android layout 布局属性
    Android 官方推荐 : DialogFragment 创建对话框
    Android 屏幕旋转 处理 AsyncTask 和 ProgressDialog 的最佳方案
    Android Fragment 真正的完全解析
    Android-Universal-Image-Loader 图片异步加载类库的使用(超详细配置)
    Visual Studio VS2013模块对于SAFESEH 映像是不安全的 怎么办
    PS 图层后面有索引两字怎么办
    PS 如何使用液化工具给人物减肥
    PS 图层后面有索引两字怎么办
  • 原文地址:https://www.cnblogs.com/dashucoding/p/11668379.html
Copyright © 2011-2022 走看看