[bugfix] Popup: ensure z-index setting order (#4026)

This commit is contained in:
neverland
2019-08-02 10:41:40 +08:00
committed by GitHub
parent d3b214a402
commit ff85de854c
6 changed files with 45 additions and 41 deletions
+15 -15
View File
@@ -168,24 +168,24 @@ export const PopupMixin = {
return;
}
if (this.overlay) {
openOverlay(this, {
zIndex: context.zIndex++,
duration: this.duration,
className: this.overlayClass,
customStyle: this.overlayStyle
});
} else {
closeOverlay(this);
}
this.$nextTick(() => {
this.updateZIndex(this.overlay ? 1 : 0);
this.updateZIndex();
if (this.overlay) {
openOverlay(this, {
zIndex: context.zIndex++,
duration: this.duration,
className: this.overlayClass,
customStyle: this.overlayStyle
});
} else {
closeOverlay(this);
}
});
},
updateZIndex() {
this.$nextTick(() => {
this.$el.style.zIndex = context.zIndex++;
});
updateZIndex(value = 0) {
this.$el.style.zIndex = ++context.zIndex + value;
}
}
};