Notifications 通知铃铛
铃铛触发器 + 未读红点徽标 + 手风琴错峰下拉面板。未读时铃铛左右摆动(可一键关闭摇铃动画),受控更新:动态推送消息 / 清空未读 / 切换摇铃。
操作日志
点击铃铛展开,点击条目查看回调
import { Notifications } from "@qingwu-ui/notifications";
import "@qingwu-ui/notifications/style.css";
const ntf = new Notifications(container, {
items: [
{ id: 1, title: "青梧 UI 0.9.0 发布", sub: "12 包全量对齐", glyph: "梧", unread: true },
{ id: 2, title: "日历邀请已通过", sub: "周三 10:00 评审会", unread: false },
],
unreadCount: 1,
ring: true, // 未读响铃摆动开关
// ringMode: "intermittent", ringInterval: 4000, // 按频率间歇重响
onItemClick: (item) => handle(item),
onOpenChange: (open) => console.log(open),
});
// 受控更新:推送 / 清未读
ntf.update({ items, unreadCount: 0 });
ntf.destroy(); // 卸载时销毁