Skip to content

Commit

Permalink
Update main.vue
Browse files Browse the repository at this point in the history
Fix page cannot scroll up and down when previewSrcList is empty
  • Loading branch information
flow authored Mar 5, 2020
1 parent 6ec5f8e commit f70bf22
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/image/src/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,12 @@
}
},
clickHandler() {
// prevent body scroll
prevOverflow = document.body.style.overflow;
document.body.style.overflow = 'hidden';
this.showViewer = true;
if (this.preview) {
// prevent body scroll
prevOverflow = document.body.style.overflow;
document.body.style.overflow = 'hidden';
this.showViewer = true;
}
},
closeViewer() {
document.body.style.overflow = prevOverflow;
Expand Down

0 comments on commit f70bf22

Please sign in to comment.