Skip to content

Commit

Permalink
Merge pull request #942 from didi/feat-movable-attrs
Browse files Browse the repository at this point in the history
feat: 动态改变movable位置时,支持通过 speed 属性控制移动速度
  • Loading branch information
hiyuki authored Feb 10, 2022
2 parents 92e22db + d767183 commit cb025c4
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@
animation: {
type: Boolean,
default: true
},
speed: {
type: Number,
default: 1000
}
},
watch: {
Expand All @@ -96,7 +100,7 @@
if (newVal < this.bs.maxScrollX) {
newVal = this.bs.maxScrollX
}
this.bs.scrollTo(newVal, this.bs.y)
this.bs.scrollTo(newVal, this.bs.y, this.speed)
},
y (newVal) {
this.source = ''
Expand All @@ -106,7 +110,7 @@
if (newVal < this.bs.maxScrollY) {
newVal = this.bs.maxScrollY
}
this.bs.scrollTo(this.bs.x, newVal)
this.bs.scrollTo(this.bs.x, newVal, this.speed)
},
scaleValue (newVal) {
this.isZooming = true
Expand Down

0 comments on commit cb025c4

Please sign in to comment.