fix(ImagePreview): fix loading when previewing images (#11376)

This commit is contained in:
Gavin 2022-12-13 10:26:22 +08:00 committed by GitHub
parent 7f834d57eb
commit 851c967ad9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -204,9 +204,11 @@ export default defineComponent({
// so the initial complete state should be checked.
// https://github.com/youzan/vant/issues/11335
onMounted(() => {
if (imageRef.value?.complete) {
onLoad();
}
nextTick(() => {
if (imageRef.value?.complete) {
onLoad();
}
});
});
return () => (