Skip to content
This repository was archived by the owner on Jul 7, 2025. It is now read-only.

Commit 1e8cfd5

Browse files
committed
fix(movable): minor bug fixes
initial position lost when direction="none"
1 parent 6bef753 commit 1e8cfd5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/KMovable/KMovableView.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ export default {
162162
this.$el.setAttribute('aria-dropeffect', 'move')
163163
this.$el.setAttribute('aria-label', '可移动')
164164
165-
this.getParentMovableArea()
166-
if (this.parentArea) this.parentArea.$emit('k-movable-view-changed')
165+
this._x = 0
166+
this._y = 0
167167
168168
if (this.friction <= 0) this.friction = 2
169169
this.frictionModel.reconfigure(1, this.friction)
@@ -202,6 +202,9 @@ export default {
202202
if (this.y) this.setY(this.y)
203203
if (this.scaleMin || this.scaleMax) this.setScaleMinOrMax()
204204
if (this.scale) this.setScale()
205+
206+
this.getParentMovableArea()
207+
if (this.parentArea) this.parentArea.$emit('k-movable-view-changed')
205208
},
206209
detached() {
207210
if (this.parentArea) this.parentArea.$emit('k-movable-view-changed')

0 commit comments

Comments
 (0)