perf: remove passive event polyfill (#9590)

This commit is contained in:
neverland
2021-09-29 17:36:50 +08:00
committed by GitHub
parent 7aba794d80
commit ec5067ce7d
3 changed files with 7 additions and 58 deletions
@@ -1,9 +1,5 @@
import { Ref, watch, onBeforeUnmount, onDeactivated } from 'vue';
import {
getScrollParent,
supportsPassive,
onMountedOrActivated,
} from '@vant/use';
import { getScrollParent, onMountedOrActivated } from '@vant/use';
import { useTouch } from './use-touch';
import { preventDefault } from '../utils';
@@ -45,11 +41,7 @@ export function useLockScroll(
const lock = () => {
document.addEventListener('touchstart', touch.start);
document.addEventListener(
'touchmove',
onTouchMove,
supportsPassive ? { passive: false } : false
);
document.addEventListener('touchmove', onTouchMove, { passive: false });
if (!totalLockCount) {
document.body.classList.add(BODY_LOCK_CLASS);