Skip to content

Commit 6939642

Browse files
authored
feat: 修复拖拽报错 (#3285)
1 parent 31703e4 commit 6939642

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/packages/__VUE/drag/index.taro.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,9 @@ export default create({
223223
})
224224
onDeactivated(() => {
225225
state.keepAlive = true
226-
;(myDrag as any).value.removeEventListener('touchstart', touchStart)
227-
;(myDrag as any).value.removeEventListener('touchmove', touchMove)
228-
;(myDrag as any).value.removeEventListener('touchend', touchEnd)
226+
;(myDrag as any).value?.removeEventListener('touchstart', touchStart)
227+
;(myDrag as any).value?.removeEventListener('touchmove', touchMove)
228+
;(myDrag as any).value?.removeEventListener('touchend', touchEnd)
229229
})
230230
return {
231231
myDrag,

src/packages/__VUE/drag/index.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ export default create({
179179
})
180180
onDeactivated(() => {
181181
state.keepAlive = true
182-
myDrag.value.removeEventListener('touchstart', touchStart)
183-
myDrag.value.removeEventListener('touchmove', touchMove)
184-
myDrag.value.removeEventListener('touchend', touchEnd)
182+
myDrag.value?.removeEventListener('touchstart', touchStart)
183+
myDrag.value?.removeEventListener('touchmove', touchMove)
184+
myDrag.value?.removeEventListener('touchend', touchEnd)
185185
})
186186
return {
187187
myDrag,

0 commit comments

Comments
 (0)