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吗??

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题