Comments (8)
Applying options on the element appears to also work:
<a
v-touch:swipe="onSwipe"
v-touch-options:swipe="{ direction: 'horizontal' }">
</a>
from vue-touch.
I might have I figured it out:
VueTouch.config.swipe = {
direction: 'horizontal'
};
Vue.use(VueTouch);
http://hammerjs.github.io/recognizer-swipe/
When calling Hammer() to create a simple instance, the pan and swipe recognizers are configured to only detect horizontal gestures.
from vue-touch.
Probably related: http://hammerjs.github.io/touch-action/
from vue-touch.
@Johnathan @yyx990803 Did you figure out a solution? I know the touch-action
should be set to pan-y
but I haven't figured out how to pass that into the element to override. Looks like options.behavior.touchAction
is what needs to be set.
from vue-touch.
I didn't. I ended up just changing the "panel" that could be swiped. Not ideal but something I can look at later on.
from vue-touch.
Is there a fix for this now?
from vue-touch.
For vue-touch@next the following works
v-on:swipeleft="swipeLeft" v-on:swiperight="swipeRight" v-bind:swipe-options="{ direction: 'horizontal' }"
from vue-touch.
- Make v-touch component empty sibling element to its content.
- Position it absolutely full screen and add CSS pointer-events: none
- Add to it tap event listener and toggle hide only on tap
- On underlying content add CSS pointer-events: all and toggle show v-touch on tap.
from vue-touch.
Related Issues (20)
- 直接下载vue-touch下载的1.0版本会报错,priority未定义,
- how to prevent parent gestures of overlapping child gestures HOT 3
- 文档内容不丰富,事件都能触发,但是触发后怎么用没有说明
- Prevent Swipe Examples
- 请问有支持Vue2.x的计划么? HOT 2
- no dom events on v-touch component HOT 1
- hammer.input recognizer
- Failed to resolve directive 'touch' HOT 3
- How to use vue-touch as well as as @click so as to support both mobile and desktop events? HOT 1
- How can i use charmmer.js in the directive?
- window is not defined
- Is this project still active HOT 2
- Can I return the index of the current slider, or can I use a method to move it to the desired slider?
- How to get this to work with Nuxt? HOT 1
- v-on:panend 在部分安卓机上失效,以前一直正常,最近突然失效了,不知道怎么处理
- 页面上下滚动的时候如何禁止左右滑动
- Typescript support? HOT 1
- hammer-ssr.js throw error!
- Just listen for swipe event
- when v-touch set tag as button, event still fire even button is disabled
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-touch.