When the Vue page pops up the mask layer, I want to prevent the page from sliding. When the mask layer ends, the page can slide. I can't slide now, but I can't release it. How to solve it?

when the Vue page pops up the mask layer, I want to prevent the page from sliding. When the mask layer ends, the page can slide. I now prohibit sliding, but I can"t remove it.
Click time appears the mask

clipboard.png

clipboard.png

when there is a time selection, the page is not allowed to slide (valid)

             document.body.addEventListener("touchmove", function (e) {
                e.preventDefault() // ()
            }, {passive: false}) // passive iosandroid

how to solve the problem that the page should be able to swipe again when the time is selected? (invalid)

             document.body.addEventListener("touchmove", function (e) {
                e.preventDefault() // ()
            }, {passive: true}) // passive iosandroid

how to solve this problem?

Aug.10,2021

function preDev (e) {
e.preventDefault ();
}
document.body.addEventListener ('touchmove', preDev, {passive: false})
when removing the cane cover
document.body.removeEventListener (' touchmove', preDev, {passive: false}) try


create a class. hidden {heigh:100%; overflow:hidden} add this class to body when the pop-up window appears, and remove it when the pop-up window is hidden.

Menu