Bind an event processing function in the component, for example, bindtap="handleTap".
<button bindtap="handleTap">test</button>
Page({
handleTap: function (event) {
console.log(event)
}
})
// Structure of the event object is as follows:
{
"type": "tap",
"timeStamp": 868,
"target": {
"id": "testView",
"dataset": {
"hi": "AtomicService"
}
},
"currentTarget": {
"id": "testView",
"dataset": {
"hi": "AtomicService"
}
},
"detail": {
"x": 59,
"y": 36
},
"touches": [
{
"identifier": 0,
"pageX": 59,
"pageY": 36,
"clientX": 59,
"clientY": 36
}
],
"changedTouches": [
{
"identifier": 0,
"pageX": 59,
"pageY": 36,
"clientX": 59,
"clientY": 36
}
]
}