fix(@vant/cli): add passive for global touchstart (#10979)

This commit is contained in:
neverland
2022-08-27 15:22:56 +08:00
committed by GitHub
parent 84b05f0668
commit 71354f7742
3 changed files with 7 additions and 2 deletions

View File

@@ -30,7 +30,7 @@
</script>
<% } %>
</head>
<body ontouchstart>
<body>
<div id="app"></div>
<script type="module" src="/desktop/main.js"></script>
</body>

View File

@@ -39,7 +39,7 @@
</script>
<% } %>
</head>
<body ontouchstart>
<body>
<div id="app"></div>
<script type="module" src="/mobile/main.js"></script>
</body>

View File

@@ -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,
});