记录 uniapp 小程序 阻止遮罩下层滚动

322 阅读1分钟
<!-- 解决遮罩下拉 bug   通过加@touchmove.stop.prevent="moveHandle"-->
<view
  v-if="showPage"
  @touchmove.stop.prevent="moveHandle"
  :class="[showPage ? 'is_hidden' : '']"
></view>

methods: {
moveHandle() {
  return;
},}

*弹窗加层蒙版 阻止下层滚动*
<style lang="scss">
// 解决遮罩下拉 bug
.is_hidden {
 z-index: 98;
 overflow: hidden;
 height: 100vh;
 width: 100%;
 left: 0;
 top: 0;
 bottom: 0;
 right: 0;
 position: fixed;
}
</style>