# 级联选择器 <Experimental></Experimental> TreeSelect <Experimental></Experimental>

- 页面: https://jiguang132.com/zh/resources/ant-design-mobile/docs/tree-select
- 资源: Ant Design Mobile (https://jiguang132.com/zh/resources/ant-design-mobile.md)
- 全部指南: https://jiguang132.com/zh/resources/ant-design-mobile/docs.md

<Alert type="error">
此组件即将重写，请尽量不要使用。
</Alert>

## 安装

```bash
npm install antd-mobile@5.43.0
```

antd-mobile 是移动网页组件库，不是 React Native 或小程序组件。React 19 项目需在入口用 `unstableSetRender` 注册 `createRoot`，否则 Toast、Dialog 等命令式 API 无法渲染；深色模式通过 `<html data-prefers-color-scheme="dark">` 切换。

示例来自 Ant Design Mobile 官方仓库（MIT），固定在 npm 5.43.0 对应的提交；示例中的 `DemoBlock` 等展示辅助组件由 JGuang 重写，不属于 antd-mobile 的 API。

<Alert type="error">
此组件即将重写，请尽量不要使用。
</Alert>

## 示例

## TreeSelect

### 属性

### TreeSelect

```typescript | pure
type TreeSelectOption = {
  label: string
  value: string
  children?: TreeSelectOption[]
}
```

| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| defaultValue | 默认选中项 | `string[]` | `[]` |
| fieldNames | 自定义 `options` 中 `label` `value` `children` 的字段 | `{ label?: string; value?: string; children?: string }` | `{}` |
| onChange | `value` 变化时触发 | `(value: string[], extend: { options: TreeSelectOption[] }) => void` | - |
| options | 级联数据 | `TreeSelectOption[]` | `[]` |
| value | 选中项 | `string[]` | `[]` |

---

JGuang 全部资源索引: https://jiguang132.com/llms.txt
