mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(Uploader): incorrect preview index when upload same images (#4577)
This commit is contained in:
parent
306d595fbd
commit
8740376218
@ -183,14 +183,13 @@ export default createComponent({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const imageFiles = this.fileList
|
const imageFiles = this.fileList.filter(item => isImageFile(item));
|
||||||
.filter(item => isImageFile(item))
|
const imageContents = imageFiles.map(item => item.content || item.url);
|
||||||
.map(item => item.content || item.url);
|
|
||||||
|
|
||||||
ImagePreview({
|
ImagePreview({
|
||||||
images: imageFiles,
|
images: imageContents,
|
||||||
closeOnPopstate: true,
|
closeOnPopstate: true,
|
||||||
startPosition: imageFiles.indexOf(item.content || item.url),
|
startPosition: imageFiles.indexOf(item),
|
||||||
onClose: () => {
|
onClose: () => {
|
||||||
this.$emit('close-preview');
|
this.$emit('close-preview');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user