[bugfix] Toast: should add z-index if previous toast has not disappeared (#3153)

This commit is contained in:
neverland 2019-04-15 19:32:02 +08:00 committed by GitHub
parent b1e3684d4c
commit ad6be337cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -201,6 +201,10 @@ export const PopupMixin = {
closeOverlay(this);
}
this.updateZIndex();
},
updateZIndex() {
this.$nextTick(() => {
this.$el.style.zIndex = context.zIndex++;
});

View File

@ -47,6 +47,11 @@ function transformer(options) {
function Toast(options = {}) {
const toast = createInstance();
// should add z-index if previous toast has not disappeared
if (toast.value) {
toast.updateZIndex();
}
options = {
...currentOptions,
...parseOptions(options),