解决办法1: 在touch的事件监听方法上绑定第三个参数{ passive: false },通过传递 passive 为 false 来明确告诉浏览器:事件处理程序调用 preventDefault 来阻止默认滑动行为。
document.body.addEventListener('touchmove', function(e){
var e = e || window.event;
// 触摸指定元素可滑动
// if (!document.querySelector('ul').contains(e.target)) e.preventDefault();
// 整个页面禁止滑动
e.preventDefault();
},{ passive: false })
解决办法2: 依靠于css样式,uni-app需要放在App.vue页面
body {
touch-action: none;
}