data(){
return {
handler: function(e) {
e.preventDefault();
}, //阻止body滑动
}
},
methods: {
closeTouch: function() {
document
.getElementsByTagName("body")[0]
.addEventListener("touchmove", this.handler, {
passive: false }); //阻止默认事件
},
openTouch: function() {
document
.getElementsByTagName("body")[0]
.removeEventListener("touchmove", this.handler, {
passive: false }); //打开默认事件
},
}
禁止微信公众号页面上下滑动
猜你喜欢
转载自blog.csdn.net/qq_43248623/article/details/110529827
今日推荐
周排行