时间:2020-11-10 16:29:41 | 栏目:vue | 点击:次
以前做遮罩层都是写最小高度来占满屏,但是总会出现问题,也没改变,今天一个人在交流群上问这个时,看到一个回答解决了我这一个bug,学到了,现在记录一下样式。
<div class='popContainer'></div>
div.popContainer{
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0,0,0,0.3);
}
这样遮罩层就会占满屏了
补充知识:vue 锁定蒙版 不让里面页面滑动
其实就是一句代码,在你的蒙版里面添加一句@touchmove.prevent就好了,下面是例子
<!-- 阴影背景层 --> <div class="layout" @touchmove.prevent :style="{'display':flag?'block':'none'}" @click="closeAction"></div>