VUE_uni-app禁止遮罩弹窗下的页面滚动的完美解决办法
写法一:在弹窗外层添加:@touchmove.stop.prevent="()=>false"写法二:在弹窗外层添加: @touchmove.prevent<template><view><view v-for="(item,i) in 100" :key="i">list</view><view class="Popup" @touch
·
写法一:在弹窗外层添加:@touchmove.stop.prevent="()=>false"
写法二:在弹窗外层添加: @touchmove.prevent
<template>
<view>
<view v-for="(item,i) in 100" :key="i">list</view>
<view class="Popup" @touchmove.prevent>
<view class="Popup_">
弹窗
</view>
</view>
</view>
</template>
<style lang="scss" scoped>
.Popup {
width: 100vw;
height: 100vh;
position: fixed;
top: 0;
left: 0;
z-index: 9999;
background: rgba(0, 0, 0, 0.4);
display: flex;
justify-content: center;
align-items: center;
.Popup_ {
width: 389rpx;
background: #FFFFFF;
border-radius: 14rpx;
}
}
</style>
更多推荐
已为社区贡献15条内容
所有评论(0)