Skip to content

Commit

Permalink
Image: Fix preview dose not show when preview list not contain src is…
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyCao authored and lzq4047 committed May 22, 2020
1 parent b75b629 commit 3cb23c6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/image/src/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@
return Array.isArray(previewSrcList) && previewSrcList.length > 0;
},
imageIndex() {
return this.previewSrcList.indexOf(this.src);
let previewIndex = 0;
const srcIndex = this.previewSrcList.indexOf(this.src);
if (srcIndex >= 0) {
previewIndex = srcIndex;
}
return previewIndex;
}
},
Expand Down

0 comments on commit 3cb23c6

Please sign in to comment.