if (bool) {
//禁止滚动
window.addEventListener('touchmove', bodyScroll, { passive: false })
} else {
//开启滚动
window.removeEventListener('touchmove', bodyScroll, { passive: false })
}
function bodyScroll(event) {
event.preventDefault()
}
这样写安卓没问题,ios不行