The problem we need to solve: When the pop-up box is displayed, the content under the pop-up box cannot be scrolled
There are a lot of pop-up boxes in small programs. As shown below, the bottom of the pop-up box is a page that can be pulled down, but when the pop-up box appears, scrolling at the bottom needs to be prohibited, so what should I do?
solution:
- Add catchtouchmove='true' to the view
<view catchtouchmove='true' ></view>
- Bind an empty method to catchtouchmove.
<view catchtouchmove='prevent' ></view>
prevent(){
return ;
}
Friendly reminder: The effect of not scrolling needs to be viewed on the real device, and the effect cannot be seen on the editor