Vue sets the mask layer to prohibit scrolling

The vue mask layer prevents the default scroll event.
When writing a mobile page, after the mask layer pops up, we can still scroll the page.
vue provides @touchmove.preventways to solve this problem perfectly

<div class="dialog" @touchmove.prevent ></div>

You can add the overflow: hidden attribute to the body to solve it.

But it is also worth mentioning that although touchmove will not move, the mouse will still scroll using the scroll key.

Guess you like

Origin blog.csdn.net/ZHXT__/article/details/106788001