要关闭页面上的所有 Notification 实例,可以使用以下方法:

  1. 使用 ElementUI 的 Notification.closeAll() 方法来关闭所有实例。这将关闭页面上的所有 Notification 实例,包括已经显示和等待显示的实例。
import { Notification } from 'element-ui'

Notification.closeAll()
  1. 如果你希望只关闭已经显示的实例,可以使用 $notify.closeAll() 方法来关闭。
this.$notify.closeAll()

注意:以上方法需要在页面中引入 ElementUI 的 Notification 组件,并在合适的时机调用。

elementuiplus Notification 关闭页面所有实例

原文地址: https://www.cveoy.top/t/topic/hPWY 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录