From 71354f77427910d8c4dd504e968078a67cf03f6c Mon Sep 17 00:00:00 2001 From: neverland Date: Sat, 27 Aug 2022 15:22:56 +0800 Subject: [PATCH] fix(@vant/cli): add passive for global touchstart (#10979) --- packages/vant-cli/site/index.html | 2 +- packages/vant-cli/site/mobile.html | 2 +- packages/vant-cli/site/mobile/main.js | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/vant-cli/site/index.html b/packages/vant-cli/site/index.html index 98a063899..5764eeda9 100644 --- a/packages/vant-cli/site/index.html +++ b/packages/vant-cli/site/index.html @@ -30,7 +30,7 @@ <% } %> - +
diff --git a/packages/vant-cli/site/mobile.html b/packages/vant-cli/site/mobile.html index 4d26f4752..e5ff77b7d 100644 --- a/packages/vant-cli/site/mobile.html +++ b/packages/vant-cli/site/mobile.html @@ -39,7 +39,7 @@ <% } %> - +
diff --git a/packages/vant-cli/site/mobile/main.js b/packages/vant-cli/site/mobile/main.js index adb8a450d..3d85b1e2b 100644 --- a/packages/vant-cli/site/mobile/main.js +++ b/packages/vant-cli/site/mobile/main.js @@ -13,3 +13,8 @@ window.app = createApp(App) setTimeout(() => { window.app.mount('#app'); }, 0); + +// https://stackoverflow.com/questions/3885018/active-pseudo-class-doesnt-work-in-mobile-safari/33681490#33681490 +document.addEventListener('touchstart', () => {}, { + passive: true, +});