mirror of
https://gitee.com/vant-contrib/vant.git
synced 2026-07-25 06:25:37 +08:00
Compare commits
2 Commits
b4e3c3374c
...
be2a401d23
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be2a401d23 | ||
|
|
6e27d02404 |
@ -192,7 +192,7 @@ export default defineComponent({
|
|||||||
const { offsetX, offsetY } = touch;
|
const { offsetX, offsetY } = touch;
|
||||||
const deltaTime = Date.now() - touchStartTime;
|
const deltaTime = Date.now() - touchStartTime;
|
||||||
const TAP_TIME = 250;
|
const TAP_TIME = 250;
|
||||||
const TAP_OFFSET = 10;
|
const TAP_OFFSET = 5;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
offsetX.value < TAP_OFFSET &&
|
offsetX.value < TAP_OFFSET &&
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import {
|
|||||||
ref,
|
ref,
|
||||||
watch,
|
watch,
|
||||||
computed,
|
computed,
|
||||||
|
nextTick,
|
||||||
onBeforeUnmount,
|
onBeforeUnmount,
|
||||||
defineComponent,
|
defineComponent,
|
||||||
getCurrentInstance,
|
getCurrentInstance,
|
||||||
@ -159,8 +160,17 @@ export default defineComponent({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onLazyLoaded = ({ el }: { el: HTMLElement }) => {
|
const onLazyLoaded = ({ el }: { el: HTMLElement }) => {
|
||||||
if (el === imageRef.value && loading.value) {
|
const check = () => {
|
||||||
onLoad();
|
if (el === imageRef.value && loading.value) {
|
||||||
|
onLoad();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (imageRef.value) {
|
||||||
|
check();
|
||||||
|
} else {
|
||||||
|
// LazyLoad may trigger loaded event before Image mounted
|
||||||
|
// https://github.com/youzan/vant/issues/10046
|
||||||
|
nextTick(check);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user