1.[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive.
兩個方案:
(1)注冊處理函數時,用如下方式,明確聲明為不是被動的
window.addEventListener('touchmove', func, { passive: false })
(2)應用 CSS 屬性 touch-action: none; 這樣任何觸摸事件都不會產生默認行為,但是 touch 事件照樣觸發。
touch-action 還有很多選項,詳細請參考touch-action
