react-hammerjs的应用
程序员文章站
2022-07-13 11:04:37
...
react-hammerjs的应用
实例:
引入:import Hammer from "react-hammerjs";
<Hammer onSwipe={this.handleSwipe} direction='DIRECTION_LEFT' > <div> ... </div> </Hammer>
Hammer有如下属性:
vertical:取值范围{true},{false}
direction:取值范围:'DIRECTION_LEFT','DIRECTION_ALL' , 'DIRECTION_HORIZONTAL',
参考:http://mirror.vsibiri.info/libraries.io/npm/react-hammerjs.htm