mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
popup component
This commit is contained in:
parent
75b86832f0
commit
042b286583
@ -1,13 +1,13 @@
|
|||||||
.v-modal {
|
|
||||||
position: fixed;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
background-color: rgba(0, 0, 0, 0.701961);
|
|
||||||
}
|
|
||||||
|
|
||||||
@component-namespace z {
|
@component-namespace z {
|
||||||
|
@b modal {
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
background-color: rgba(0, 0, 0, 0.701961);
|
||||||
|
}
|
||||||
|
|
||||||
@b popup {
|
@b popup {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
@ -131,10 +131,8 @@ export default {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (this.modal && this.bodyOverflow !== 'hidden') {
|
if (this.modal && this.bodyOverflow !== 'hidden') {
|
||||||
document.body.style.overflow = this.bodyOverflow;
|
document.body.style.overflow = this.bodyOverflow;
|
||||||
document.body.style.paddingRight = this.bodyPaddingRight;
|
|
||||||
}
|
}
|
||||||
this.bodyOverflow = null;
|
this.bodyOverflow = null;
|
||||||
this.bodyPaddingRight = null;
|
|
||||||
}, 200);
|
}, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ const PopupManager = {
|
|||||||
|
|
||||||
const modalStack = this.modalStack;
|
const modalStack = this.modalStack;
|
||||||
|
|
||||||
for (let i = 0, j = modalStack.length; i < j; i++) {
|
for (let i = 0, len = modalStack.length; i < len; i++) {
|
||||||
const item = modalStack[i];
|
const item = modalStack[i];
|
||||||
if (item.id === id) {
|
if (item.id === id) {
|
||||||
return;
|
return;
|
||||||
@ -79,10 +79,7 @@ const PopupManager = {
|
|||||||
|
|
||||||
const modalDom = getModal();
|
const modalDom = getModal();
|
||||||
|
|
||||||
addClass(modalDom, 'v-modal');
|
addClass(modalDom, 'z-modal');
|
||||||
setTimeout(() => {
|
|
||||||
removeClass(modalDom, 'v-modal-enter');
|
|
||||||
}, 200);
|
|
||||||
|
|
||||||
if (dom && dom.parentNode && dom.parentNode.nodeType !== 11) {
|
if (dom && dom.parentNode && dom.parentNode.nodeType !== 11) {
|
||||||
dom.parentNode.appendChild(modalDom);
|
dom.parentNode.appendChild(modalDom);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user