有使生效有时无效
template===
<view class="bottom" >
<text @tap.stop="tabMask">底部区域</text>
<view class="mask" v-if="maskT" @touchmove.stop.prevent="moveHandle">
<view class="mask-con" @tap="tabMask" >
蒙版内部
</view>
</view>
</view>
script===
data() {
return {
maskT:false
}
},
methods: {
tabMask(){
this.maskT = !this.maskT
},
moveHandle(){ //禁止蒙版下内容滑动
},
}
style===
.bottom{
width: 690rpx;
height: 600rpx;
margin: 0 auto;
text-align: center;
margin-top: 300rpx;
font-size: 48rpx;
}
.mask{
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 999;
background-color: rgba(0,0,0,0.5);
}
.mask-con{
position: absolute;
top: calc(50% - 300rpx);
left: calc(50% - 345rpx);
width: 690rpx;
height: 600rpx;
background-color: #FFFFFF;
border-radius: 32rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 48rpx;
}