1.什么是事件
- 事件是一种用户的行为,一种通讯方式
2.事件类别
- 点击事件tap
- 长按事件longtap
- 触摸事件touchstart touchend(手指离开屏幕触发touchend) touchmove touchcalcel(当来电话或其他触发touchcancel)
- 其他 submit input...
3.事件冒泡
-
冒泡事件
-
非冒泡事件
-
新建一个项目
image.png
![](https://img.haomeiwen.com/i11949096/3c272678d9701e74.png)
![](https://img.haomeiwen.com/i11949096/5892ff46ad4499e9.png)
![](https://img.haomeiwen.com/i11949096/d0d7ff60673fa21d.png)
![](https://img.haomeiwen.com/i11949096/298257d602054d86.png)
![](https://img.haomeiwen.com/i11949096/8fcaf89865b0f011.png)
4.事件绑定
- bind绑定
-
catch绑定
image.png
5.事件对象详解
![](https://img.haomeiwen.com/i11949096/0086e55e6f34d3e5.png)
![](https://img.haomeiwen.com/i11949096/e5cc322002bb47e1.png)
![](https://img.haomeiwen.com/i11949096/0b50f1c0c07e8695.png)
![](https://img.haomeiwen.com/i11949096/bf1a6175bf0739af.png)
- 类型type
- 时间戳timeStamp
- 事件源组件target
- 当前组件currentTarget
- 触摸点数touches
网友评论