From 9a5079062959022ee4314bf2719b8cd32974b1f7 Mon Sep 17 00:00:00 2001 From: fangxiang Date: Thu, 22 Sep 2022 19:58:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dipad=E4=B8=8B=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=9B=B4=E6=96=B0=E5=85=A8=E5=B1=8F=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E7=9A=84BUG=E3=80=82=E7=A6=81=E7=94=A8ipad=E5=8F=8C=E5=87=BB?= =?UTF-8?q?=E6=94=BE=E5=A4=A7=E5=8A=9F=E8=83=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 31 +++++++++++++++++++++++++++++++ src/index.template.html | 4 ++++ src/pad/Login.vue | 6 +++--- src/pad/MainLayout.vue | 13 +++++++++++++ 4 files changed, 51 insertions(+), 3 deletions(-) diff --git a/src/App.vue b/src/App.vue index 13643dd..560aa43 100644 --- a/src/App.vue +++ b/src/App.vue @@ -241,6 +241,37 @@ export default defineComponent({ $store.commit("updateLandspace", landspace()); + if ( + $q.platform.is.ios || + $q.platform.is.ipad || + $q.platform.is.safari || + $q.platform.is.iphone + ) { + // 阻止双击放大 + var lastTouchEnd = 0; + document.addEventListener("touchstart", function (event: any) { + if (event.touches.length > 1) { + event.preventDefault(); + } + }); + document.addEventListener( + "touchend", + function (event) { + var now = new Date().getTime(); + if (now - lastTouchEnd <= 300) { + event.preventDefault(); + } + lastTouchEnd = now; + }, + false + ); + + // 阻止双指放大 + document.addEventListener("gesturestart", function (event) { + event.preventDefault(); + }); + } + return {}; }, }); diff --git a/src/index.template.html b/src/index.template.html index d3c7fce..4b1984f 100644 --- a/src/index.template.html +++ b/src/index.template.html @@ -16,6 +16,10 @@ +