提交 e951e412 编写于 作者: Q qiang

fix: 修复 movable 组件限制仅横向或纵向移动时,移动可能中断的问题

上级 7d9ec54a
<template>
<uni-movable-view v-on="$listeners">
<v-uni-resize-sensor @resize="setParent"/>
<slot/>
<v-uni-resize-sensor @resize="setParent" />
<slot />
</uni-movable-view>
</template>
<script>
......@@ -317,28 +317,16 @@ export default {
x = event.detail.dx + this.__baseX
this.__touchInfo.historyX.shift()
this.__touchInfo.historyX.push(x)
if (!this.yMove) {
if (!null !== this._checkCanMove) {
if (Math.abs(event.detail.dx / event.detail.dy) > 1) {
this._checkCanMove = false
} else {
this._checkCanMove = true
}
}
if (!this.yMove && this._checkCanMove === null) {
this._checkCanMove = Math.abs(event.detail.dx / event.detail.dy) < 1
}
}
if (this.yMove) {
y = event.detail.dy + this.__baseY
this.__touchInfo.historyY.shift()
this.__touchInfo.historyY.push(y)
if (!this.xMove) {
if (!null !== this._checkCanMove) {
if (Math.abs(event.detail.dy / event.detail.dx) > 1) {
this._checkCanMove = false
} else {
this._checkCanMove = true
}
}
if (!this.xMove && this._checkCanMove === null) {
this._checkCanMove = Math.abs(event.detail.dy / event.detail.dx) < 1
}
}
this.__touchInfo.historyT.shift()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册