解决 IOS 移动端页面根容器可拖拽滑动

1,464 阅读1分钟

原生JS

document.body.addEventListener("touchmove", bodyScroll, false);
function bodyScroll(event) {
  event.preventDefault();
}

VUE

@touchmove.prevent

CSS

body {
    position: fixed;
    overflow: hidden;
}