Skip to content

Commit

Permalink
fix: 修复当传入字符串 max-scale 和 min-scale 时, 缩放到临界值报错的问题 #7
Browse files Browse the repository at this point in the history
  • Loading branch information
朱文涵 committed Jul 12, 2020
1 parent 21dc212 commit 7a3cc6b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ImagePreview/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,10 @@ export default {
if (Number.isFinite(zoomRate)) {
// 限制缩放范围在“设定范围之内”
if (zoomRate < this.minScale) {
this.scale = this.minScale
} else if (zoomRate > this.maxScale) {
this.scale = this.maxScale
if (zoomRate < this.innerMinScale) {
this.scale = this.innerMinScale
} else if (zoomRate > this.innerMaxScale) {
this.scale = this.innerMaxScale
} else {
this.scale = zoomRate
}
Expand Down

0 comments on commit 7a3cc6b

Please sign in to comment.