Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cl199793 committed Apr 10, 2020
1 parent 5916d28 commit e945608
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/image/src/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,12 @@
return Array.isArray(previewSrcList) && previewSrcList.length > 0;
},
imageIndex() {
let srcIndex = 0;
if (this.previewSrcList.includes(this.src)) {
srcIndex = this.previewSrcList.indexOf(this.src);
let previewIndex = 0;
const srcIndex = this.previewSrcList.indexOf(this.src);
if (srcIndex >= 0) {
previewIndex = srcIndex;
}
return srcIndex;
return previewIndex;
}
},
Expand Down

0 comments on commit e945608

Please sign in to comment.