From d92929d5821819fd4cf12e6e0139c96f395b11cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E4=BD=B3=E5=AE=87?= <17601616548@163.com> Date: Tue, 15 Oct 2024 20:22:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BF=94=E5=9B=9E=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- h5/pages/components/goHome.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/h5/pages/components/goHome.vue b/h5/pages/components/goHome.vue index 74089b5..5685b30 100644 --- a/h5/pages/components/goHome.vue +++ b/h5/pages/components/goHome.vue @@ -17,16 +17,17 @@ const button = ref(null); let startX, startY, posX, posY, mouseMoveTracker, mouseUpTracker; const goHome = () => { - console.log(11); uni.reLaunch({ url: "/pages/main/index/index" }); }; const dragButton = (event) => { // event.preventDefault(); - - // 初始化坐标 - startX = event.touches[0]?.clientX - button.value.offsetLeft; - startY = event.touches[0]?.clientY - button.value.offsetTop; + console.log(event.touches, "48566546546545"); + if (event.touches) { + // 初始化坐标 + startX = event.touches[0]?.clientX - button.value.offsetLeft; + startY = event.touches[0]?.clientY - button.value.offsetTop; + } // 添加鼠标移动监听 mouseMoveTracker = (event) => {