mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[bugfix] Toast: should add z-index if previous toast has not disappeared (#3153)
This commit is contained in:
parent
b1e3684d4c
commit
ad6be337cc
@ -201,6 +201,10 @@ export const PopupMixin = {
|
|||||||
closeOverlay(this);
|
closeOverlay(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.updateZIndex();
|
||||||
|
},
|
||||||
|
|
||||||
|
updateZIndex() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$el.style.zIndex = context.zIndex++;
|
this.$el.style.zIndex = context.zIndex++;
|
||||||
});
|
});
|
||||||
|
@ -47,6 +47,11 @@ function transformer(options) {
|
|||||||
function Toast(options = {}) {
|
function Toast(options = {}) {
|
||||||
const toast = createInstance();
|
const toast = createInstance();
|
||||||
|
|
||||||
|
// should add z-index if previous toast has not disappeared
|
||||||
|
if (toast.value) {
|
||||||
|
toast.updateZIndex();
|
||||||
|
}
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
...currentOptions,
|
...currentOptions,
|
||||||
...parseOptions(options),
|
...parseOptions(options),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user