解决方法1
使用全局样式样式去掉
- { touch-action: pan-y; }
解决办法2
通过传递 passive 为 false 来明确告诉浏览器:事件处理程序调用 preventDefault 来阻止默认滑动行为。
elem.addEventListener(
'touchstart',
fn,
{ passive: false }
);
使用全局样式样式去掉
- { touch-action: pan-y; }
通过传递 passive 为 false 来明确告诉浏览器:事件处理程序调用 preventDefault 来阻止默认滑动行为。
elem.addEventListener(
'touchstart',
fn,
{ passive: false }
);
本文标题:taro开发之H5的坑:错误提示Unable to preven
本文链接:https://www.haomeiwen.com/subject/amcbtltx.html
网友评论