smart-gesture for react.
JavaScript HTML
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.github
example
lib
src
test
.babelrc
.eslintrc
.gitignore
LICENSE
README.md
karma.conf.js
package.json
tests.webpack.js
webpack.build.config.js
webpack.config.js
webpack.prepublish.config.js

README.md

react-smart-gesture

鼠标手势组件 smart-gesture 的 React 版本。

安装

npm install react-smart-gesture --save

使用

import React, { Component } from 'react';
import SmartGesture from 'react-smart-gesture';

class App extends Component {
  _onGesture(res, points) {
    console.log(res, points);
  }

  _onSwipe(directionList) {
    console.log(directionList);
  }

  render() {
    const options = {
      lineColor: 'red',
      timeDelay: 0,
      triggerMouseKey: 'left',
      onSwipe: this._onSwipe,
      onGesture: this._onGesture,
    };
    return (
      <div className="demo">
        <SmartGesture options={options} />
      </div>
    );
  }
}

export default App;

详细使用方法可以参考: demo

文档

参考 smart-gesture 文档

贡献指南

请在提交 PR 前阅读我们的贡献指南

License

MIT