@touchstart="touchStart(event)"
touchStart(event) {
console.log(event);
console.log("touch start");
}
为什么事件返回未定义?
事件在定义它们的不同上下文中执行。因此,我们需要将它们绑定到它所附加的对象。React代码中会有很多这样的绑定语句。查看更多细节
为什么需要在构造函数中绑定函数