Skip to content

usePointerSwipe

基于 PointerEvents 的反应式滑动检测。

¥Reactive swipe detection based on PointerEvents.

示例

Swipe

用法

¥Usage

vue
<script setup lang="ts">
import { 
usePointerSwipe
} from '@vueuse/core'
import {
useTemplateRef
} from 'vue'
const
el
=
useTemplateRef
('el')
const {
isSwiping
,
direction
} =
usePointerSwipe
(
el
)
</script> <template> <
div
ref
="
el
">
Swipe here </
div
>
</template>