useDraggableDistance
获取拖拽距离
演示
示例
vue
<template>
<div ref="targetRef" :style="{ transform: `translate(${x}px, ${y}px)` }">
...
</div>
</template>
<script lang="ts" setup>
import { useDraggableDistance } from '@mixte/use';
import { ref } from 'vue';
const targetRef = ref();
const { x, y, isDragging } = useDraggableDistance(targetRef);
</script>