说明
Color 支持预设语义色,也支持直接传入 CSS 颜色值。
常见能力:
- 语义色
- 可关闭
- 可点击
- Icon 图标前置
用法
<Tag Color="success" Text="已完成" />
<Tag Color="warning" Icon="clock" Text="处理中" />
API 参数
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
ChildContent |
RenderFragment |
null |
|
Closable |
bool |
false |
可关闭。 |
Color |
string |
null |
语义色,决定标签底色:primary / success / warning / danger。 留空则为默认灰底。 |
Icon |
string |
null |
前置图标。 |
OnClick |
EventCallback<MouseEventArgs> |
— | 事件 |
OnClose |
EventCallback |
— | 事件 关闭回调。 |
Size |
string |
null |
尺寸:lg / sm。 |
Text |
string |
null |
标签文字。 |
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 群