跳至主要內容

Badge

小于 1 分钟

支持自定义颜色的徽章。

你可以在 Markdown 中使用这个组件来为标题或链接添加一些状态。

示例

标题勋章 MrHope

勋章测试 构建中 MrHope

## 标题勋章 <Badge text="新" type="tip" /> <Badge text="MrHope" color="grey" />

勋章测试 <Badge text="构建中" type="warning" /> <Badge text="MrHope" color="grey" />

属性

text

  • 类型: string
  • 必填: 是

徽章的文字

type

  • 类型: "tip" | "warning" | "danger" | "info" | "note"
  • 默认值: "info"

徽章的类型

  • tip
  • warning
  • danger
  • info
  • note

color

  • 类型: string
  • 必填: 否

徽章的颜色,填入在 CSS 中合法的颜色值。

vertical

  • 类型: "top" | "middle" | "baseline" | "bottom"
  • 必填: 否

徽章的垂直方向的位置