hookehuyr

fix(ImageUploaderField): 修复图片预览时起始位置不正确的问题

设置点击图片的索引作为预览起始位置,确保预览时显示正确的图片
......@@ -59,7 +59,7 @@
</div>
</van-overlay>
<van-image-preview v-model:show="show" :images="default_list" @change="onChange">
<van-image-preview v-model:show="show" :images="default_list" :start-position="index" @change="onChange">
<template v-slot:index>第{{ index + 1 }}张</template>
</van-image-preview>
</template>
......@@ -390,7 +390,8 @@ const validImageUploader = () => {
// 预览只读图片
const onImgClick = (i) => {
show.value = true
index.value = i; // 设置点击的图片索引
show.value = true;
}
const show = ref(false);
......