跳转到内容
本站为社区维护的非官方中文翻译,与 Cloudflare, Inc. 无关联。本站不提供账户登录,请勿在任何非官方站点输入您的 Cloudflare 账户信息。官方文档:developers.cloudflare.com

徽章

最后更新 查看 MarkdownAgent 设置

The Badge component is used 89 times on 33 pages.

See all examples of pages that use Badge

Used 89 times.

Pages

Partials

徽章是 Nimbus ↗ 提供的内置组件。例如,使用它们来表示产品处于 Beta 阶段。

组件

import { Badge } from "~/components";

<Badge text="Note" variant="note" />
<Badge text="Success" variant="success" />
<Badge text="Tip" variant="tip" />
<Badge text="Caution" variant="caution" />
<Badge text="Danger" variant="danger" />
<Badge text="Default" />

侧边栏

可以通过页面 frontmatter 将徽章添加到侧边栏。

---
title: Hello World
sidebar:
  badge:
    variant: tip
    text: New
---

如果您想向产品添加 Beta 徽章,请省略 variant: 条目:

---
title: Hello World
sidebar:
  badge:
    text: Beta
---

这篇文档对您有帮助吗?