Open any86 opened 2 years ago
https://codesandbox.io/s/charming-beaver-qq4ozv?file=/src/components/HelloWorld.vue
移动端会触发mouse事件, 这个是我之前不知道的, 所以我的手势库在"不阻止默认"的情况下, 在手机上touch/mouse都会触发. 如果touchstart内阻止默认了, 那么mouse相关事件都不会触发了.
这里只是记录, 稍后版本要做些兼容
this.$el.addEventListener('touchstart', e=>{ e.preventDefault(); }) this.$el.addEventListener('mousedown', e=>{ e.preventDefault(); }) this.$el.addEventListener('mouseup', e=>{ alert(e.type) })
https://codesandbox.io/s/charming-beaver-qq4ozv?file=/src/components/HelloWorld.vue
移动端会触发mouse事件, 这个是我之前不知道的, 所以我的手势库在"不阻止默认"的情况下, 在手机上touch/mouse都会触发. 如果touchstart内阻止默认了, 那么mouse相关事件都不会触发了.
这里只是记录, 稍后版本要做些兼容