Pārlūkot izejas kodu

首页AI图标拖拽

zhujindu 7 mēneši atpakaļ
vecāks
revīzija
754140ee4c
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  1. 3 0
      src/directive/dialog/drag.js

+ 3 - 0
src/directive/dialog/drag.js

@@ -15,7 +15,9 @@ export default {
     el.addEventListener(
       'touchstart',
       (e) => {
+        e.preventDefault();
         e.stopPropagation();
+        e.currentTarget.style.touchAction = 'none';
         const touch = e.touches[0];
         initialTouchX = touch.clientX;
         initialTouchY = touch.clientY;
@@ -27,6 +29,7 @@ export default {
     el.addEventListener(
       'touchmove',
       function (e) {
+        e.preventDefault();
         e.stopPropagation();
         const clientX = e.targetTouches[0].clientX;
         const clientY = e.targetTouches[0].clientY;