mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
chore(ImagePreview): reuse isTap ref (#12536)
This commit is contained in:
parent
5580b1be1b
commit
2f9f961bd8
@ -16,7 +16,6 @@ import {
|
|||||||
createNamespace,
|
createNamespace,
|
||||||
makeRequiredProp,
|
makeRequiredProp,
|
||||||
LONG_PRESS_START_TIME,
|
LONG_PRESS_START_TIME,
|
||||||
TAP_OFFSET,
|
|
||||||
type ComponentInstance,
|
type ComponentInstance,
|
||||||
} from '../utils';
|
} from '../utils';
|
||||||
|
|
||||||
@ -264,13 +263,12 @@ export default defineComponent({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { offsetX, offsetY } = touch;
|
|
||||||
const deltaTime = Date.now() - touchStartTime;
|
const deltaTime = Date.now() - touchStartTime;
|
||||||
|
|
||||||
// Same as the default value of iOS double tap timeout
|
// Same as the default value of iOS double tap timeout
|
||||||
const TAP_TIME = 250;
|
const TAP_TIME = 250;
|
||||||
|
|
||||||
if (offsetX.value < TAP_OFFSET && offsetY.value < TAP_OFFSET) {
|
if (touch.isTap.value) {
|
||||||
if (deltaTime < TAP_TIME) {
|
if (deltaTime < TAP_TIME) {
|
||||||
// allow double to scale
|
// allow double to scale
|
||||||
if (props.doubleScale) {
|
if (props.doubleScale) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user