ctx.notification
基于 Ant Design Notification 的全局通知 API,用于在页面右上角显示通知面板。与 ctx.message 相比,通知可带标题与描述,适合较长时间展示、需用户留意的内容。
适用场景
类型定义
NotificationInstance 为 Ant Design notification 接口,提供以下方法。
常用方法
配置参数(与 Ant Design notification 一致):
示例
基础用法
按类型快捷调用
自定义持续时间与 key
关闭所有通知
与 ctx.message 的区别
相关
- ctx.message - 顶部轻提示,适合快速反馈
- ctx.modal - 弹窗确认,阻塞式交互
- ctx.t() - 国际化,常与 notification 配合使用

