handleToShowDialog(){
console.log("显示弹窗")
this.showDialog=true;
var mo=function(e){e.preventDefault();};
document.body.style.overflow='hidden';
document.addEventListener("touchmove",mo,false);//禁止页面滑动
},
handleToHideDialog(){
console.log("关闭弹窗")
this.showDialog=false;
var mo=function(e){e.preventDefault();};
document.body.style.overflow='';//出现滚动条
document.removeEventListener("touchmove",mo,false);
},
在点击显示弹窗的地方加上@click="handleToShowDialog"
关闭弹窗的地方加上@click="handleToHideDialog"
this.showDialog控制弹窗的显示与隐藏,初始为showDialog:false