美文网首页
vue 移动端模拟弹窗时,禁止页面滑动

vue 移动端模拟弹窗时,禁止页面滑动

作者: 汶沐 | 来源:发表于2019-01-25 18:42 被阅读0次

    bodyScroll(event) {
     event.preventDefault()
    },
    stopScroll () {
     document.body.style.overflow = 'hidden'
     document.addEventListener('touchmove', this.bodyScroll, false)
    }, 

    startScroll () {
     document.body.style.overflow = ''// 出现滚动条
     document.removeEventListener('touchmove', this.bodyScroll, false)
    },

    相关文章

      网友评论

          本文标题:vue 移动端模拟弹窗时,禁止页面滑动

          本文链接:https://www.haomeiwen.com/subject/aeevjqtx.html