vue 弹层滑动穿透问题简单解决方案

问题:在vue开发过程中,遇到了一个这样的问题,当弹框和蒙层出现的时候,还能继续滑动,也就是说出现了滑动穿透。

解决方案:还好 vue提供的 @touchmove.prevent 可以用来阻止滑动。蒙层和弹框同时使用,具体用法形如:<div @touchmove.prevent></div>

注意:当弹框中包含滚动内容的时候 也会被禁止掉

猜你喜欢

转载自www.cnblogs.com/liuruikang/p/9660618.html
今日推荐