最近弄小程序遮罩層穿透問題,網上好多資源設置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