From 77356f05e4cd76313045dd69d193e5b0ffa4cbc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E9=AA=90=E5=BD=B0?= Date: Tue, 17 Jun 2025 16:11:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DH5=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E5=90=8E=E5=89=8D=E4=B8=80=E4=B8=AA=E9=A1=B5=E9=9D=A2=E8=AE=BE?= =?UTF-8?q?=E7=BD=AEbody=20overflow:hidden=E5=AF=BC=E8=87=B4=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=BB=91=E5=8A=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/uni-popup/uni-popup.vue | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/uni_modules/uni-popup/components/uni-popup/uni-popup.vue b/uni_modules/uni-popup/components/uni-popup/uni-popup.vue index 5af55e01..d2200171 100644 --- a/uni_modules/uni-popup/components/uni-popup/uni-popup.vue +++ b/uni_modules/uni-popup/components/uni-popup/uni-popup.vue @@ -130,12 +130,16 @@ showPopup(show) { // #ifdef H5 // fix by mehaotian 处理 h5 滚动穿透的问题 + if (!this.isActive) { + return + } document.getElementsByTagName('body')[0].style.overflow = show ? 'hidden' : 'visible' // #endif } }, data() { return { + isActive: true, duration: 300, ani: [], showPopup: false, @@ -237,21 +241,25 @@ // #ifndef VUE3 // TODO vue2 destroyed() { + this.isActive = false; this.setH5Visible() }, // #endif // #ifdef VUE3 // TODO vue3 unmounted() { + this.isActive = false; this.setH5Visible() }, // #endif activated() { - this.setH5Visible(!this.showPopup); - }, - deactivated() { - this.setH5Visible(true); - }, + this.isActive = true; + this.setH5Visible(!this.showPopup); + }, + deactivated() { + this.isActive = false; + this.setH5Visible(true); + }, created() { // this.mkclick = this.isMaskClick || this.maskClick if (this.isMaskClick === null && this.maskClick === null) {