说明
Count 超过 Max 时显示为 Max+;Dot 为真时只显示圆点。
常见能力:
- 数字角标
- 超量显示
- 圆点模式
- 内嵌子元素
用法
<Badge Count="5" />
<Badge Count="128" Max="99" />
<Badge Dot="true" Color="danger" />
API 参数
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
ChildContent |
RenderFragment |
null |
|
Color |
string |
"danger" |
颜色:primary / success / warning / danger。 |
Count |
int |
0 |
数字,0 时不渲染内容(可配合 ChildContent)。 |
Dot |
bool |
false |
纯圆点。 |
Icon |
string |
null |
前置图标。 |
Max |
int |
99 |
超出后折叠为 n+,0 表示不折叠。 |
Size |
string |
null |
尺寸:lg。 |
Title |
string |
null |
|
Visible |
bool |
true |
取得或设置组件是否可见,默认为false。 |
VisibleChanged |
EventCallback<bool> |
— | 事件 取得或设置组件可见性变化时的回调事件。 |
Class |
string |
null |
取得或设置组件的CSS类名,用于自定义样式。 |
Disabled |
bool |
false |
取得或设置组件是否禁用,默认为false。 |
Style |
string |
null |
取得或设置组件的内联样式,用于自定义样式。 |
所有组件均继承
BaseComponent,除上表参数外还支持Class、Style、Disabled、Visible。
扫码关注公众号
扫码加入 QQ 群