最近弄小程序遮罩层穿透问题,网上好多资源设置catchtouchmove="preventD"便可,本人测试后好像仍是不行,而后就找了其余方法,测试有效。css
一、js ,data内初始化状态标识小程序
showModalStatus: false
二、在相应的view 上加上判断代码测试
class="{{showModalStatus?'C_scroll':''}}"
三、css 代码spa
.C_scroll { top: 0px; left: 0px; width: 100%; height: 100vh; overflow: hidden; position: fixed; z-index: 0; }
有兴趣的能够加杭州小程序交流群:497030311code