diff --git a/.vitepress/theme/components/Card.vue b/.vitepress/theme/components/Card.vue index 2fd884e..9b3fd1d 100644 --- a/.vitepress/theme/components/Card.vue +++ b/.vitepress/theme/components/Card.vue @@ -20,34 +20,6 @@ const props = withDefaults(defineProps(), { variant: "feed", impression: () => [], }); - -const isSwapped = ref(false); -let touchStartX = 0; - -// 是否有多张图片 -const hasMultipleImages = () => props.impression && props.impression.length >= 2; - -// 处理开始触摸 -const handleTouchStart = (e: TouchEvent) => { - if (!hasMultipleImages()) return; - touchStartX = e.touches[0].clientX; -}; - -// 处理结束触摸 -const handleTouchEnd = (e: TouchEvent) => { - if (!hasMultipleImages()) return; - const touchEndX = e.changedTouches[0].clientX; - const diff = touchStartX - touchEndX; - - // 滑动距离超过 50px 视为有效 - if (Math.abs(diff) > 50) { - if (diff > 0) { - isSwapped.value = true; - } else { - isSwapped.value = false; - } - } -};