![]() |
||
---|---|---|
.. | ||
example/finger | ||
README.md | ||
omi-finger.js | ||
omi-finger.png | ||
package.json | ||
webpack.config.js |
README.md
omi-finger
Omi的AlloyFinger插件,让你轻松在Omi项目里支持各种触摸事件和手势。
Demo
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.