any-touch
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -1,4 +0,3 @@ | ||
let log = console.log; | ||
log = () => { }; | ||
log = () => {}; | ||
new Vue({ | ||
@@ -19,6 +18,15 @@ el: '#app', | ||
mounted() { | ||
const tap2 = new AnyTouch.TapRecognizer({ name: 'doubletap', pointer: 1, taps: 2 }) | ||
const tap3 = new AnyTouch.TapRecognizer({ name: 'threetap', pointer: 1, taps: 3 }) | ||
const tap2 = new AnyTouch.TapRecognizer({ | ||
name: 'doubletap', | ||
pointer: 1, | ||
taps: 2 | ||
}) | ||
const tap3 = new AnyTouch.TapRecognizer({ | ||
name: 'threetap', | ||
pointer: 1, | ||
taps: 3 | ||
}) | ||
const anyTouch = new AnyTouch(this.$refs.circle); | ||
anyTouch.get('pan').set({pointerLength:1}); | ||
const pan = anyTouch.get('pan'); | ||
pan.set({ threshold: 0 }); | ||
anyTouch.add(tap2); | ||
@@ -57,4 +65,5 @@ anyTouch.add(tap3); | ||
anyTouch.on('pan', e => { | ||
console.log(e.direction); | ||
if(e.nativeEvent.cancelable && 'down' === e.direction) { | ||
console.log(e.centerX, e.centerY); | ||
log(e.direction); | ||
if (e.nativeEvent.cancelable && 'down' === e.direction) { | ||
e.preventDefault(); | ||
@@ -61,0 +70,0 @@ } |
{ | ||
"name": "any-touch", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "一个手势库", | ||
@@ -5,0 +5,0 @@ "main": "dist/anyTouch.common.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
209084
5520