提交 af96366b 编写于 作者: Q qiang

fix: 解决h5端pc模式图像预览页面滑动会关闭的问题

上级 ad65b436
......@@ -36,9 +36,26 @@ export default {
const index = typeof this.current === 'number' ? this.current : this.urls.indexOf(this.current)
this.index = index < 0 ? 0 : index
},
mounted () {
const MAX_MOVE = 20
let x = 0
let y = 0
this.$el.addEventListener('mousedown', (event) => {
this.preventDefault = false
x = event.clientX
y = event.clientY
})
this.$el.addEventListener('mouseup', (event) => {
if (Math.abs(event.clientX - x) > MAX_MOVE || Math.abs(event.clientY - y) > MAX_MOVE) {
this.preventDefault = true
}
})
},
methods: {
_click () {
getApp().$router.back()
if (!this.preventDefault) {
getApp().$router.back()
}
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册