Skip to content

Commit

Permalink
Merge pull request #857 from liujiayii/master
Browse files Browse the repository at this point in the history
bugfix(popup): 修复H5环境下切换页面后overflow:hidden仍然生效的问题
  • Loading branch information
18148764734 authored Mar 19, 2024
2 parents 62cc340 + 59d385b commit 008d62c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions uni_modules/uni-popup/components/uni-popup/uni-popup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@
unmounted() {
this.setH5Visible()
},
activated() {
this.setH5Visible(!this.showPopup);
},
deactivated() {
this.setH5Visible(true);
},
// #endif
created() {
// this.mkclick = this.isMaskClick || this.maskClick
Expand All @@ -252,10 +258,10 @@
this.maskClass.backgroundColor = this.maskBackgroundColor
},
methods: {
setH5Visible() {
setH5Visible(visible = true) {
// #ifdef H5
// fix by mehaotian 处理 h5 滚动穿透的问题
document.getElementsByTagName('body')[0].style.overflow = 'visible'
document.getElementsByTagName('body')[0].style.overflow = visible ? "visible" : "hidden";
// #endif
},
/**
Expand Down

0 comments on commit 008d62c

Please sign in to comment.