含光
含光
  • 发布:2020-10-30 12:40
  • 更新:2021-10-13 12:56
  • 阅读:9561

uniapp中uni.showToast,uni.showModal层级问题

分类:uni-app

H5上只要有个居中模块的定位z-index超过的999就不会显示uni.showToast和uni.showModa的l内容,这个没有办法做到和小程序一样的吗?永远都是最高层级,那么是否还有其他的组件也有这个问题呢?如果有,请列出所有

2020-10-30 12:40 负责人:无 分享
已邀请:
2***@qq.com

2***@qq.com

在 app.vue 添加拦截器 try { const showModal = uni.showModal; Object.defineProperty(uni, "showModal", { get() { try { const element: any = document.querySelector("uni-modal"); if (element) { element.style.zIndex = (that as any).$popupIndex ? (that as any).$popupIndex * 2 2000 * 2; }
} catch (e) {}
return showModal;
},
});
富婆

富婆

遇到同样问题

7***@qq.com

7***@qq.com

uni-toast {
z-index: 10000;
}

该问题目前已经被锁定, 无法添加新回复