omi/plugins/omi-finger
dntzhang 48cadc0d2d support Omi.deletePlugin method 2017-04-11 08:49:46 +08:00
..
example/finger update omi-finger 2017-03-02 15:31:18 +08:00
README.md update omi-finger 2017-03-02 15:31:18 +08:00
omi-finger.js support Omi.deletePlugin method 2017-04-11 08:49:46 +08:00
omi-finger.png update omi-transform 2017-02-13 16:55:41 +08:00
package.json update omi-finger 2017-03-03 15:49:49 +08:00
webpack.config.js update finger demo 2017-02-13 10:11:40 +08:00

README.md

omi-finger

Omi的AlloyFinger插件让你轻松在Omi项目里支持各种触摸事件和手势。


Demo

omi-finger

http://alloyteam.github.io/omi/plugins/omi-finger/example/finger/

通过npm安装

npm install omi-finger

使用

import Omi from 'omi';
import OmiFinger from '../../omi-finger.js';

OmiFinger.init();

class App extends Omi.Component {
    constructor(data) {
        super(data);
    }

    handleTap(evt){
        this.refs.touchArea.innerHTML+='<br/>Tap';
    }

    handleSwipe(evt){
        this.refs.touchArea.innerHTML+='<br/>Swipe-'+ evt.direction;
    }

    render() {
        return  `
        <div>
            <div omi-finger ref="touchArea" tap="handleTap"  swipe="handleSwipe" >
                Tap or Swipe Me!
            </div>
        </div>
        `;
    }
}

Omi.render(new App(),"#container");

License

This content is released under the MIT License.