mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 10:44:59 +00:00
[bugfix] Toast: should add z-index if previous toast has not disappeared (#3153)
This commit is contained in:
@@ -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),
|
||||
|
Reference in New Issue
Block a user