fix(cp排行榜): 处理页面margin结合fixed 遮罩导致的遮罩层偏移的问题

This commit is contained in:
hzj 2026-06-02 10:31:12 +08:00
parent 52a8bbba12
commit b5f0770112
2 changed files with 8 additions and 2 deletions

View File

@ -26,6 +26,10 @@ const props = defineProps({
type: Boolean,
required: true,
},
lockScroll: {
type: Boolean,
default: true,
},
})
let lockCount = 0
@ -95,6 +99,8 @@ const unlockPageScroll = () => {
watch(
() => props.maskLayerShow,
(newVal) => {
if (!props.lockScroll) return
if (newVal) {
lockPageScroll()
} else {
@ -105,7 +111,7 @@ watch(
)
onUnmounted(() => {
if (props.maskLayerShow) {
if (props.lockScroll && props.maskLayerShow) {
unlockPageScroll()
}
})

View File

@ -393,7 +393,7 @@
</div>
<!-- 弹窗遮罩层 -->
<maskLayer class="couple-popup-mask" :maskLayerShow="maskLayerShow">
<maskLayer class="couple-popup-mask" :maskLayerShow="maskLayerShow" :lockScroll="false">
<div class="couple-popup-content" @click.self="closedPopup">
<!-- 我的伴侣弹窗 -->
<div v-show="myCoupleShow" style="position: fixed; bottom: 0; width: 100%">