uni-app 事件以及事件綁定

事件修飾符 stop的使用會阻止冒泡,可是同時綁定了一個非冒泡的事件,會致使該元素上的catchEventName失效!app

prevent能夠直接幹掉,由於uni-app裏沒有什麼默認事件,好比submit並不會跳轉頁面。3d

self沒有能夠判斷的標識code

once也不能作,由於uni-app沒有removeEventListener,雖然能夠直接在handleProxy中處理,但很是的不優雅,違背了願意,暫不考慮按鍵修飾符:uni-app運行在手機端,沒有鍵盤事件,因此不支持按鍵修飾符。blog

view 視圖容器事件

hover-class 類型爲string,默認值none 指定按下去的樣式類,類hover-class="none"時,沒有點擊態效果ip

hover-stop-propagation 類型boolean,默認值false 指定是否阻止本節點的祖先節點出現點擊態rem

hover-start-time 類型number,默認值50 按住後多久出現點擊態get

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 的使用會阻止冒泡swiper


若本號內容有作得不到位的地方(好比:涉及版權或其餘問題),請及時聯繫咱們進行整改便可,會在第一時間進行處理。


請點贊!由於大家的贊同/鼓勵是我寫做的最大動力!

歡迎關注達達的簡書!

這是一個有質量,有態度的博客

博客

相關文章
相關標籤/搜索