Preview Updated 2026-05-10

NotificationCenter

Notification history panel with unread count, mark-all-read, and clear controls.

Basic usage

Each notification is structured data: { id, title, description?, tone?, timestamp?, read?, actionLabel? }. Unread items show a colored dot on the left.

<CfNotificationCenter
:items="items"
@item-action="onAction"
@mark-all-read="markAllRead"
@clear-all="clearAll"
/>
<CfNotificationCenter
items={items}
onItemAction={onAction}
onMarkAllRead={markAllRead}
onClearAll={clearAll}
/>

Empty state

When items: [], emptyText is shown; replace with custom copy as needed.

<CfNotificationCenter :items="[]" empty-text="You're all caught up" />
<CfNotificationCenter items={[]} emptyText="You're all caught up" />

API

PropTypeDefaultDescription
itemsNotificationItem[]
openbooleantrueVisibility
showMarkAllRead / showClearAllbooleantrue
emptyTextstring'No notifications'
maxHeightnumber | string480Scroll area height

Events: item-click / item-action / mark-all-read / clear-all / close.

反馈与讨论

NotificationCenter · Discussion

0
0 / 600
一键发送
正在加载评论...