handleTouchStart = e => {
this.startY = e.touches[0].clientY;
};
handleTouchMove = e => {
this.endY = e.touches[0].clientY;
console.log(
this.startY > this.endY ? "上滑" : "下滑",
this.endY - this.startY
);
};
<div onTouchStart={this.handleTouchStart} onTouchMove={this.handleTouchMove}></div