<gcanvas class="canvas" @touchstart="touchstart" @touchmove="touchmove" @touchend="touchend" ref="gcanvess" fillStyle="#EEEEEE"></gcanvas>
touchstart(e) {
console.log(e)
}
产品分类: uniapp/App
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: 11.3.1
HBuilderX类型: 正式
HBuilderX版本号: 3.1.18
手机系统: iOS
手机系统版本号: iOS 13.4
手机厂商: 苹果
手机机型: iphone xsmax
页面类型: nvue
打包方式: 云端
项目创建方式: HBuilderX
<gcanvas class="canvas" @touchstart="touchstart" @touchmove="touchmove" @touchend="touchend" ref="gcanvess" fillStyle="#EEEEEE"></gcanvas>
touchstart(e) {
console.log(e)
}
detail对象有返回数据
{
"type": "touchstart",
"timeStamp": 1625369393899,
"target": {
"id": "",
"dataset": {},
"offsetLeft": 0,
"offsetTop": 0
},
"currentTarget": {
"id": "",
"dataset": {},
"offsetLeft": 0,
"offsetTop": 0
},
"detail": {},
"touches": [{
"screenY": 511.3333282470703,
"identifier": 4,
"force": 0,
"screenX": 170.66665649414062,
"pageY": 511.3333282470703,
"pageX": 170.66665649414062
}],
"changedTouches": [{
"screenY": 511.3333282470703,
"identifier": 4,
"force": 0,
"screenX": 170.66665649414062,
"pageY": 511.3333282470703,
"pageX": 170.66665649414062
}],
"stopPropagation": "function() { [native code] }"
}
touchstart事件的回调中的detail对象为空,无法获取内部元素偏移量,也无法获取当前点击的是哪个内部元素
1 个回复
陌上华年
放弃吧 官方并不推荐使用gcanvas