tap(e) {
console.log(e)
},

- 发布:2022-09-29 11:59
- 更新:2022-10-08 21:21
- 阅读:233
【报Bug】Map@tap方法获取不到坐标轴信息
产品分类: HbuilderX
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win11
HBuilderX版本号: 3.6.4
示例代码:
操作步骤:
tap(e) {
console.log(e)
},
tap(e) {
console.log(e)
},
预期结果:
{
"_processed": true,
"changedTouches": {
"0": {
"clientX": 145,
"clientY": 333,
"force": 1,
"identifier": 0,
"pageX": 145,
"pageY": 333
},
"length": 1
},
"currentTarget": {
"dataset": {},
"id": "map",
"offsetLeft": 0,
"offsetTop": 44
},
"detail": {
"x": 145,
"y": 333
},
"mp": {
"@warning": "mp is deprecated",
"changedTouches": {
"0": {
"clientX": 145,
"clientY": 333,
"force": 1,
"identifier": 0,
"pageX": 145,
"pageY": 333
},
"length": 1
},
"currentTarget": {
"dataset": {},
"id": "map",
"offsetLeft": 0,
"offsetTop": 44
},
"detail": {
"x": 145,
"y": 333
},
"preventDefault": "function (){}",
"stopPropagation": "function (){}",
"target": {
"dataset": {},
"id": "map",
"offsetLeft": 0,
"offsetTop": 44,
"x": 145,
"y": 333
},
"timeStamp": 36248.000000006869,
"touches": {
"0": {
"clientX": 145,
"clientY": 333,
"force": 1,
"identifier": 0,
"pageX": 145,
"pageY": 333
},
"length": 1
},
"type": "click"
},
"preventDefault": "function (){}",
"stopPropagation": "function (){}",
"target": {
"dataset": {},
"id": "map",
"offsetLeft": 0,
"offsetTop": 44,
"x": 145,
"y": 333
},
"timeStamp": 36248.000000006869,
"touches": {
"0": {
"clientX": 145,
"clientY": 333,
"force": 1,
"identifier": 0,
"pageX": 145,
"pageY": 333
},
"length": 1
},
"type": "click"
}
{
"_processed": true,
"changedTouches": {
"0": {
"clientX": 145,
"clientY": 333,
"force": 1,
"identifier": 0,
"pageX": 145,
"pageY": 333
},
"length": 1
},
"currentTarget": {
"dataset": {},
"id": "map",
"offsetLeft": 0,
"offsetTop": 44
},
"detail": {
"x": 145,
"y": 333
},
"mp": {
"@warning": "mp is deprecated",
"changedTouches": {
"0": {
"clientX": 145,
"clientY": 333,
"force": 1,
"identifier": 0,
"pageX": 145,
"pageY": 333
},
"length": 1
},
"currentTarget": {
"dataset": {},
"id": "map",
"offsetLeft": 0,
"offsetTop": 44
},
"detail": {
"x": 145,
"y": 333
},
"preventDefault": "function (){}",
"stopPropagation": "function (){}",
"target": {
"dataset": {},
"id": "map",
"offsetLeft": 0,
"offsetTop": 44,
"x": 145,
"y": 333
},
"timeStamp": 36248.000000006869,
"touches": {
"0": {
"clientX": 145,
"clientY": 333,
"force": 1,
"identifier": 0,
"pageX": 145,
"pageY": 333
},
"length": 1
},
"type": "click"
},
"preventDefault": "function (){}",
"stopPropagation": "function (){}",
"target": {
"dataset": {},
"id": "map",
"offsetLeft": 0,
"offsetTop": 44,
"x": 145,
"y": 333
},
"timeStamp": 36248.000000006869,
"touches": {
"0": {
"clientX": 145,
"clientY": 333,
"force": 1,
"identifier": 0,
"pageX": 145,
"pageY": 333
},
"length": 1
},
"type": "click"
}
实际结果:
{
"_processed": true,
"changedTouches": [{
"force": 1,
"identifier": 0
}],
"currentTarget": {
"dataset": {},
"id": "map",
"offsetLeft": 0,
"offsetTop": 44
},
"detail": {},
"mp": {
"@warning": "mp is deprecated",
"changedTouches": [{
"force": 1,
"identifier": 0
}],
"currentTarget": {
"dataset": {},
"id": "map",
"offsetLeft": 0,
"offsetTop": 44
},
"detail": {},
"preventDefault": "function(){}",
"stopPropagation": "function(){}",
"target": {
"dataset": {},
"id": "map",
"offsetLeft": 0,
"offsetTop": 44
},
"timeStamp": 0,
"touches": [{
"force": 1,
"identifier": 0
}],
"type": "click"
},
"preventDefault": "function(){}",
"stopPropagation": "function(){}",
"target": {
"dataset": {},
"id": "map",
"offsetLeft": 0,
"offsetTop": 44
},
"timeStamp": 0,
"touches": [{
"force": 1,
"identifier": 0
}],
"type": "click"
}
{
"_processed": true,
"changedTouches": [{
"force": 1,
"identifier": 0
}],
"currentTarget": {
"dataset": {},
"id": "map",
"offsetLeft": 0,
"offsetTop": 44
},
"detail": {},
"mp": {
"@warning": "mp is deprecated",
"changedTouches": [{
"force": 1,
"identifier": 0
}],
"currentTarget": {
"dataset": {},
"id": "map",
"offsetLeft": 0,
"offsetTop": 44
},
"detail": {},
"preventDefault": "function(){}",
"stopPropagation": "function(){}",
"target": {
"dataset": {},
"id": "map",
"offsetLeft": 0,
"offsetTop": 44
},
"timeStamp": 0,
"touches": [{
"force": 1,
"identifier": 0
}],
"type": "click"
},
"preventDefault": "function(){}",
"stopPropagation": "function(){}",
"target": {
"dataset": {},
"id": "map",
"offsetLeft": 0,
"offsetTop": 44
},
"timeStamp": 0,
"touches": [{
"force": 1,
"identifier": 0
}],
"type": "click"
}
bug描述:
3.6.4中Map组件和@tap无法获取到changedTouches的"clientX“ 、"clientY"等坐标轴信息,恢复到3.5.3正常。另:win11下更改内置浏览器大小仍会造成HBX卡死,把内置浏览器拖出HBX再还原就不会出现问题。
1 个回复
DCloud_UNI_Anne
哪个平台?vue版本2还是3?页面类型(vue?nvue?)请补充更多详细信息提供复现示例,方便定位问题,【社区问题/bug处理优先级规则】:https://ask.dcloud.net.cn/article/38139