QBadge(徽标)组件用于创建一个小徽标来添加一些引人注目的信息,例如经常有人把他放在头像组件上来显示有几条新消息。
用法
Accessibility v2.25+
QBadge renders with role="status" — a polite live region — and takes its aria-label from the label prop, so a badge whose label changes after render is announced automatically (content coming through the default slot is read as plain text instead).
A floating badge is attached to its host element only visually; there is no programmatic association between the two. Make sure the host’s own accessible name carries the badge’s meaning — “Inbox, 4 unread” rather than a bare “4” floating next to an unlabeled icon.