You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To enable swipe event listeners on a given element use the function initSwipeEvents located in utils/tools.js.
The parameters to the initSwipeEvents function are el the element which event listeners will be added to and deltaMin the minimum swipe distance required to fire a swipe event. The default value of deltaMin is 80.
The events emitted by this function are swipeUp, swipeDown, swipeRight, swipeLeft
An example of a component:
import initSwipeEvents from "~/utils/initSwipeEvents"
<template>
<div
@swipe-right="foo"
@swipe-left="bar"
@swipe-up="foo"
@swipe-down="bar"
/>
</template>
<script>
export default {
mounted() {
// 80 is the default, you can leave it empty normally
initSwipeEvents(this.$el, 80)
}
}
</script>