问题描述:
在使用dialog对话框等有modal遮罩层的组件时,再使用Notification通知组件便会遇到,遮罩层把通知掩盖住了
解决方案:
在element文档中有custom-class这样的属性,我们可以给Notification组件自定义一个类,并在全局改写其z-index
ElNotification({
title: 'Success',
customClass: 'http-message',
message: 'This is a success message',
type: 'success',
})
// App.vue
<style lang="less">
.http-message {
z-index: 9000 !important;
}
</style>
效果就实现了