vue2移动端 router-view 弹出时候 滑动页面 ios下 有时会触发上一层滑动,请问怎么解决?

vue2移动端 router-view 弹出后, 滑动页面 有时候会有时会触发上一层滑动,缩放时候也会看见下一层页面,请问怎么解决?谢谢!

阅读 3.1k
2 个回答

已解决,router-view 层设置如下

data () {
    return {
      y:0
    }
  },
created(){
    this.y = document.body.scrollTop
    document.body.setAttribute("class","hid");
  },
  destroyed(){
    document.body.removeAttribute("class","hid");
    document.body.scrollTop = this.y
  },
//样式中
.hid{
  position: fixed;
}

你是添加了transition吗??

推荐问题