Files
twenty/packages/twenty-docs/l/zh/twenty-ui/input/select.mdx
T
github-actions[bot] 68f4cf269d i18n - docs translations (#22281)
Created by Github action

<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/twentyhq/twenty/pull/22281?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->

Co-authored-by: github-actions <github-actions@twenty.com>
2026-06-29 07:22:03 +02:00

55 lines
1.7 KiB
Plaintext

---
title: 选择
---
<Frame>
<img src="/images/user-guide/what-is-twenty/20.png" alt="标题" />
</Frame>
允许用户从预定义选项列表中选择一个值。
<Tabs>
<Tab title="**用法**">
```jsx
import { IconTwentyStar } from 'twenty-ui/display';
import { Select } from '@/ui/input/components/Select';
export const MyComponent = () => {
return (
<Select
className
disabled={false}
label="Select an option"
options={[
{ value: 'option1', label: 'Option A', Icon: IconTwentyStar },
{ value: 'option2', label: 'Option B', Icon: IconTwentyStar },
]}
value="option1"
/>
);
};
```
</Tab>
<Tab title="属性">
| 属性 | 类型 | 描述 |
| --------- | --- | ---------------------------------------------------------------- |
| className | 字符串 | 用于额外样式的可选 CSS 类 |
| 禁用 | 布尔值 | 当设置为`true`时,禁用用户与组件的交互 |
| 标签 | 字符串 | 描述`选择`组件用途的标签 |
| onChange | 函数 | 当所选值更改时调用的函数 |
| 选项 | 数组 | 表示`选择`组件的可用选项。 它是一个对象数组,每个对象具有一个`值`(唯一标识符)、`标签`(唯一标识符)和一个可选的`图标` |
| 值 | 字符串 | 表示当前选择的值。 它应匹配`选项`数组中的一个`值`属性 |
</Tab>
</Tabs>