Browse Source

fix(drag): resolve console error (#1634)

Drjingfubo 3 years ago
parent
commit
66a7c5d2d6
2 changed files with 6 additions and 6 deletions
  1. 3 3
      src/packages/__VUE/drag/index.taro.vue
  2. 3 3
      src/packages/__VUE/drag/index.vue

+ 3 - 3
src/packages/__VUE/drag/index.taro.vue

@@ -225,9 +225,9 @@ export default create({
     });
     onDeactivated(() => {
       state.keepAlive = true;
-      (myDrag as any).removeEventListener('touchstart', touchStart);
-      (myDrag as any).removeEventListener('touchmove', touchMove);
-      (myDrag as any).removeEventListener('touchend', touchEnd);
+      (myDrag as any).value.removeEventListener('touchstart', touchStart);
+      (myDrag as any).value.removeEventListener('touchmove', touchMove);
+      (myDrag as any).value.removeEventListener('touchend', touchEnd);
     });
     return {
       classes,

+ 3 - 3
src/packages/__VUE/drag/index.vue

@@ -185,9 +185,9 @@ export default create({
     });
     onDeactivated(() => {
       state.keepAlive = true;
-      (myDrag as any).removeEventListener('touchstart', touchStart);
-      (myDrag as any).removeEventListener('touchmove', touchMove);
-      (myDrag as any).removeEventListener('touchend', touchEnd);
+      (myDrag as any).value.removeEventListener('touchstart', touchStart);
+      (myDrag as any).value.removeEventListener('touchmove', touchMove);
+      (myDrag as any).value.removeEventListener('touchend', touchEnd);
     });
     return {
       classes,