【发布时间】:2017-06-30 20:37:22
【问题描述】:
在 react-native webview 中构建一个 html 画布页面。除了 canvas.addEventListener 使用空事件对象调用回调之外,一切看起来都很好
var moveEvents = ["mousemove", "touchmove"]
moveEvents.forEach(function (moveEvent) {
canvas.addEventListener(moveEvent, function(e) {
console.log(e) // {}
mouse.x = e.pageX - this.offsetLeft;
mouse.y = e.pageY - this.offsetTop;
}, false);
不知道可能出了什么问题 这种行为只在 react-native 上被注意到这是代码在 jsfiddle 上按预期工作
【问题讨论】:
-
有没有想过这个?
标签: javascript android webview react-native