1-因为弹框比较长,前面弹框的内容弹出的时候需要滑动,但是后台需要禁止滚动2-所以用watch监听,弹出的时候禁止滚动-弹出窗口,弹出框消失后允许滚动`//首先显示模态框//Coach详细信息分享卡片ShowCoachCard(res){this.coachCard=true;}然后监控,当模态框弹出时,控制手表:{coachCard(newVal,oldVal){if(newVal==true){console.log('gaibianl');letcssStr="overflow-y:hidden;height:100%;";document.getElementsByTagName('html')[0].style.cssText=cssStr;文档.body.style.cssText=cssStr;}else{letcssStr="overflow-y:auto;height:auto;";document.getElementsByTagName('html')[0].style.cssText=cssStr;文档.body.style.cssText=cssStr;}//下面两行代码需要兼容不同的浏览器document.body.scrollTop=this.pageScrollYoffset;window.scroll(0,this.pageScrollYoffset);}},`这里的样式,首先,这个modal框必须放在页面的最顶端
