From f5c38f8b454699951cde262cda7ce78b96478fc0 Mon Sep 17 00:00:00 2001 From: haoziqaq <357229046@qq.com> Date: Fri, 4 Mar 2022 22:39:17 +0800 Subject: [PATCH] fix(ui/image-preview): fix isTapTouch --- packages/varlet-ui/src/image-preview/ImagePreview.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/varlet-ui/src/image-preview/ImagePreview.vue b/packages/varlet-ui/src/image-preview/ImagePreview.vue index f8f1e67c588..96621d50b39 100644 --- a/packages/varlet-ui/src/image-preview/ImagePreview.vue +++ b/packages/varlet-ui/src/image-preview/ImagePreview.vue @@ -87,6 +87,7 @@ type VarTouch = { const DISTANCE_OFFSET = 12 const EVENT_DELAY = 200 +const TAP_DELAY = 500 const ANIMATION_DURATION = 200 export default defineComponent({ @@ -170,6 +171,7 @@ export default defineComponent({ return ( getDistance(startTouch, prevTouch) <= DISTANCE_OFFSET && + Date.now() - prevTouch.timestamp < TAP_DELAY && (target === startTouch.target || target.parentNode === startTouch.target) ) }