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);
|
||||
}
|
||||
|
||||
this.updateZIndex();
|
||||
},
|
||||
|
||||
updateZIndex() {
|
||||
this.$nextTick(() => {
|
||||
this.$el.style.zIndex = context.zIndex++;
|
||||
});
|
||||
|
@ -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),
|
||||
|
Loading…
x
Reference in New Issue
Block a user