const disableZoom = () => {//禁止缩放
let lastTouchEnd = 0;
document.documentElement.addEventListener('touchend', (event) => {//禁止双击放大
var now = Date.now();
if (now - lastTouchEnd <= 300) {
event.preventDefault();
}
lastTouchEnd = now;
}, false);
document.documentElement.addEventListener('touchstart', (event) => {//禁止双指缩放
if (event.touches.length > 1) {
event.preventDefault();
}
}, false);
}