mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix: popup will not preventScroll by default
This commit is contained in:
parent
306a6417d1
commit
865f92f735
@ -4,16 +4,12 @@ import PopupContext from './popup-context';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
/**
|
// popup当前显示状态
|
||||||
* popup当前显示状态
|
|
||||||
*/
|
|
||||||
value: {
|
value: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
/**
|
// 是否显示遮罩层
|
||||||
* 是否显示遮罩层
|
|
||||||
*/
|
|
||||||
overlay: {
|
overlay: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
@ -26,13 +22,16 @@ export default {
|
|||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
zIndex: [String, Number],
|
zIndex: [String, Number],
|
||||||
/**
|
// popup滚动时是否body内容也滚动
|
||||||
* popup滚动时是否body内容也滚动
|
// 默认为不滚动
|
||||||
* 默认为不滚动
|
|
||||||
*/
|
|
||||||
lockOnScroll: {
|
lockOnScroll: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
|
},
|
||||||
|
// 防止滚动穿透
|
||||||
|
preventScroll: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -137,8 +136,11 @@ export default {
|
|||||||
this.$el.style.zIndex = PopupManager.nextZIndex();
|
this.$el.style.zIndex = PopupManager.nextZIndex();
|
||||||
this.opened = true;
|
this.opened = true;
|
||||||
this.opening = false;
|
this.opening = false;
|
||||||
document.addEventListener('touchstart', this.recordPosition, false);
|
|
||||||
document.addEventListener('touchmove', this.watchTouchMove, false);
|
if (this.preventScroll) {
|
||||||
|
document.addEventListener('touchstart', this.recordPosition, false);
|
||||||
|
document.addEventListener('touchmove', this.watchTouchMove, false);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user