微信小程序事件中对象获取
1、打开小程序开发工具,新建‘myIndex’项目,在项目的pages页面新建page,名为mypage,并在app.json中将mypage设为第一页面

3、在mypage.wxss中,为上面的三个view设置样式,代码如下:.view1{width: 100%;height: 200rpx;background-color: red;}.view2{width: 50%;height: 100rpx;background-color: blue;}.view3{width: 50%;height: 50rpx;background-color: wheat;}

5、编译运行代码,点击左侧的view3,即最小的view,在console观察打印的内容

7、展开view1 click下面的currentTarget和target子项,看到了dataset子项 id 值分别为view1和view3。因为此事件是view3被点击冒泡到了view1事件。
