https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html
1,webgl和2d真机不显示canvas内容
2,真机上无法捕获坐标
{type: "touchstart", timeStamp: 10015, target: {…}, touches: Array(1), changedTouches: Array(1)}changedTouches: [{…}]target: {id: "myCanvas", target: "myCanvas", dataset: {…}, offsetTop: 23, offsetLeft: 0}timeStamp: 10015touches: [{…}]type: "touchstart"__proto__: Object
VM33:2 Wed May 06 2020 21:23:27 GMT+0800 (中国标准时间) 事件警告
VM33:2 Do not have end handler in component: pages/test/test. Please make sure that end handler has been defined in pages/test/test.
E @ VM33:2
(anonymous) @ VM33:2
(anonymous) @ VM33:2
(anonymous) @ VM33:2
(anonymous) @ VM33:2
i.emit @ VM33:2
emit @ VM33:2
(anonymous) @ VM33:2
(anonymous) @ VM33:2
m @ VM33:2
value @ runtime.js?devtools_ignore=true:1
(anonymous) @ VM186:1
c @ runtime.js?devtools_ignore=true:1
w @ runtime.js?devtools_ignore=true:1
ke.onmessage @ runtime.js?devtools_ignore=true:1
test.js? [sm]:81 undefined undefined
test.js? [sm]:82 {type: "touchstart", timeStamp: 12444, target: {…}, touches: Array(6), changedTouches: Array(1)}changedTouches: [{…}]target: {id: "myCanvas", target: "myCanvas", dataset: {…}, offsetTop: 23, offsetLeft: 0}timeStamp: 12444touches: (6) [ƒ, ƒ, ƒ, ƒ, ƒ, {…}]type: "touchstart"__proto__: Object
大致可能的原因是冒泡事件冲突,但是真机不显示图片这事儿还是无解
华为p20pro,微信版本7.0.13, 基础库版本2.11.0
最小demo
可以看到一块紫红色,不对吗?
测试了下iPhone xs和华为HONOR V20都可以正确响应bindtouchstart获取坐标呀。