主题
Badge 徽标
状态点徽标。6×6 圆点,12 色 + disabled 态。
v1 实现范围
- ✅
Badge(dot-only) — 12 色 variant + disabled - ⏳
Badge-Count(number / text pill, 16 高,hug content) · v1.1
色板
theme美餐绿,用于普通强调warning橙黄,注意类error红,通知 / 错误(默认)apricot杏色,柔和提示orange橙green功能绿(非品牌)teal青blue蓝indigo靛蓝purple紫magenta品红white中性白disabled通用置灰态(color 任意)用法
vue
<Badge color="error" /> <!-- 默认红色,最常见 -->
<Badge color="theme" /> <!-- 美餐绿 -->
<Badge color="warning" /> <!-- 橙黄 -->
<Badge color="white" /> <!-- 中性白 -->
<Badge color="error" disabled /> <!-- 置灰 -->通常贴在父元素的右上角(绝对定位):
vue
<div style="position: relative; display: inline-block">
<Button type="trans" icon-only icon="general/notification" />
<Badge color="error" style="position: absolute; top: 2px; right: 2px" />
</div>Props
| Prop | 类型 | 默认 | 说明 |
|---|---|---|---|
color | 'theme' | 'warning' | 'error' | 'apricot' | 'orange' | 'green' | 'teal' | 'blue' | 'indigo' | 'purple' | 'magenta' | 'white' | 'error' | 圆点颜色,对应 --mc-<hue>-2 token |
disabled | boolean | false | 置灰态,覆盖 color,颜色变为 --mc-n-1 |