hookehuyr

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

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