上代码
/***滑动限制***/
stop(){
var mo=function(e){e.preventDefault();};
document.body.style.overflow='hidden';
document.addEventListener("touchmove",mo,false);//禁止页面滑动
},
/***取消滑动限制***/
move(){
var mo=function(e){e.preventDefault();};
document.body.style.overflow='';//出现滚动条
document.removeEventListener("touchmove",mo,true);//页面可以滑动
}
移动端弹出框时可以调用使用者两个方法,如果不是Vue,可以直接给html设置overflow:hinder
---------------------
作者:cdx1170776994
来源:CSDN
原文:https://blog.csdn.net/cdx1170776994/article/details/78775020