### 小程序2018-01-16
####小程序简单事件
- 小程序中所有的点击、触摸事件均为冒泡事件(?)
- 点击事件可将原来的 bindtap(冒泡) 换成 catchtap (非冒泡)
- 可以通过点击事件中打印出event事件,观察冒泡与非冒泡不同
- currentTarget属性中注意dataset开发环境中常常用到,需要在标签内写入 data-xxx 就可以在dataset中取值
<view class="view1" id='view1' bindtap='view1' data-title="dataset"> view1 <view class="view2" id='view2' bindtap='view2'> view2 <view class="view3" id='view3' catchtap='view3'> view3 </view> </view> </view>
//javascript
view1: function (event){ console.log(event) console.log("this is view1") }, view2: function (event) { console.log(event) console.log("this is view2") }, view3: function (event) { console.log(event) console.log("this is view3") },