Files
locadex-agent[bot] 4d96b3bfcd docs(locadex): add translations (#2745)
Co-authored-by: locadex-agent[bot] <217277504+locadex-agent[bot]@users.noreply.github.com>
2026-01-16 23:56:59 +00:00

80 lines
2.8 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "选项卡"
description: "使用选项卡组织内容,以展示不同的选项或版本。"
keywords: ["标签式内容", "内容面板", "可切换内容"]
---
使用选项卡将内容组织为多个面板,用户可以在它们之间切换。你可以添加任意数量的选项卡,并在每个选项卡内包含其他组件。
<Tabs>
<Tab title="第一个标签页">
☝️ 欢迎来到只能在第一个标签页中看到的内容。
你可以在选项卡中添加任意数量的组件。例如,一个代码块:
```java HelloWorld.java
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
</Tab>
<Tab title="第二个标签页" icon="leaf">
✌️ 这里是只在第二个标签页中的内容。
这个还带有一个 <Icon icon="leaf" /> 图标!
</Tab>
<Tab title="第三个标签页">
💪 这里是只在第三个标签页中的内容。
</Tab>
</Tabs>
````mdx Tabs example
<Tabs>
<Tab title="第一个标签页">
☝️ 欢迎来到只能在第一个标签页中看到的内容。
你可以在选项卡中添加任意数量的组件。例如,一个代码块:
```java HelloWorld.java
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
</Tab>
<Tab title="Second tab" icon="leaf">
✌️ Here's content that's only inside the second tab.
This one has a <Icon icon="leaf" /> icon!
</Tab>
<Tab title="Third tab">
💪 Here's content that's only inside the third tab.
</Tab>
</Tabs>
````
当标签相同时,Tabs 会在同一页面上自动与其他标签页和[代码分组](/zh/components/code-groups)同步。当你选择某个标签页时,所有具有相同标签的其他标签页和代码分组都会同步更新为你的选择。
<div id="properties">
## 属性
</div>
<ResponseField name="title" type="string" required>
标签页的标题。标题越短,越便于导航。标题相同的选项卡会同步其选中状态。
</ResponseField>
<ResponseField name="icon" type="string">
一个 [Font Awesome](https://fontawesome.com/icons) icon、[Lucide](https://lucide.dev/icons) icon、指向图标的 URL,或图标的相对路径。
</ResponseField>
<ResponseField name="iconType" type="string">
仅适用于 Font Awesome 图标:可选值之一为 `regular`、`solid`、`light`、`thin`、`sharp-solid`、`duotone`、`brands`。
</ResponseField>
<ResponseField name="borderBottom" type="boolean">
为标签页容器添加底部边框和内边距。用于在视觉上将标签页中的内容与页面的其他部分区分开来,尤其当各标签页包含的内容长短不一时非常有用。
</ResponseField>