Browse Source

docs: note about select value

close #31608
close #31599
pull/31617/head
afc163 3 years ago
parent
commit
38e9d309f4
  1. 1
      CHANGELOG.en-US.md
  2. 1
      CHANGELOG.zh-CN.md
  3. 30
      components/select/index.en-US.md
  4. 30
      components/select/index.zh-CN.md

1
CHANGELOG.en-US.md

@ -2285,6 +2285,7 @@ Ant Design 4.0-rc released! Here is the release [document](https://github.com/an
- 🌟 Tree Enhanced accessibility support and keyboard interaction. [#18866](https://github.com/ant-design/ant-design/pull/18866)
- 🌟 Select uses virtual scrolling and enhanced accessibility support and keyboard interaction. [#18658](https://github.com/ant-design/ant-design/pull/18658)
- 🌟 Uncontrolled mode when `value` is `undefined` now.
- 🌟 multiple Select won't rerender if `value` is mutable.
- 🌟 TreeSelect uses virtual scrolling and optimizes keyboard support. [#19040](https://github.com/ant-design/ant-design/pull/19040)
- 🌟 Uncontrolled mode when `value` is `undefined` now.
- 🌟 Button adds `default` and `link` styles for `danger`. [#19837](https://github.com/ant-design/ant-design/pull/19837)

1
CHANGELOG.zh-CN.md

@ -2288,6 +2288,7 @@ Ant Design 4.0-rc 发布,发布文档请查看[此处](https://github.com/ant-
- 🌟 `value``undefined` 时,改为非受控模式。
- 🌟 TreeSelect 使用虚拟滚动并优化键盘支持。[#19040](https://github.com/ant-design/ant-design/pull/19040)
- 🌟 `value``undefined` 时,改为非受控模式。
- 🌟 `value` 引用未变化时,不再重新渲染多选 Select。
- 🌟 Button 添加 `danger``default``link` 样式。[#19837](https://github.com/ant-design/ant-design/pull/19837)
- 🌟 Form 与 ConfigProvider 支持 `size` 设置包含组件尺寸。[#20570](https://github.com/ant-design/ant-design/pull/20570)
- 🌟 Typography 增加 `suffix` 属性。[#20224](https://github.com/ant-design/ant-design/pull/20224)

30
components/select/index.en-US.md

@ -62,7 +62,7 @@ Select component to select value from options.
| suffixIcon | The custom suffix icon | ReactNode | - | |
| tagRender | Customize tag render | (props) => ReactNode | - | |
| tokenSeparators | Separator used to tokenize on `tag` and `multiple` mode | string\[] | - | |
| value | Current selected option | string \| string\[]<br />number \| number\[]<br />LabeledValue \| LabeledValue\[] | - | |
| value | Current selected option (considered as a immutable array) | string \| string\[]<br />number \| number\[]<br />LabeledValue \| LabeledValue\[] | - | |
| virtual | Disable virtual scroll when set to false | boolean | true | 4.1.0 |
| onBlur | Called when blur | function | - | |
| onChange | Called when select an option or input value change | function(value, option:Option \| Array&lt;Option>) | - | |
@ -81,26 +81,26 @@ Select component to select value from options.
### Select Methods
| Name | Description | Version |
| --- | --- | --- |
| blur() | Remove focus | |
| focus() | Get focus | |
| Name | Description | Version |
| ------- | ------------ | ------- |
| blur() | Remove focus | |
| focus() | Get focus | |
### Option props
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| className | The additional class to option | string | - | |
| disabled | Disable this option | boolean | false | |
| title | `title` of Select after select this Option | string | - | |
| value | Default to filter with this property | string \| number | - | |
| Property | Description | Type | Default | Version |
| --------- | ------------------------------------------ | ---------------- | ------- | ------- |
| className | The additional class to option | string | - | |
| disabled | Disable this option | boolean | false | |
| title | `title` of Select after select this Option | string | - | |
| value | Default to filter with this property | string \| number | - | |
### OptGroup props
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| key | Group key | string | - | |
| label | Group label | string \| React.Element | - | |
| Property | Description | Type | Default | Version |
| -------- | ----------- | ----------------------- | ------- | ------- |
| key | Group key | string | - | |
| label | Group label | string \| React.Element | - | |
## FAQ

30
components/select/index.zh-CN.md

@ -63,7 +63,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/_0XzgOis7/Select.svg
| suffixIcon | 自定义的选择框后缀图标 | ReactNode | - | |
| tagRender | 自定义 tag 内容 render | (props) => ReactNode | - | |
| tokenSeparators | 在 `tags``multiple` 模式下自动分词的分隔符 | string\[] | - | |
| value | 指定当前选中的条目 | string \| string\[]<br />number \| number\[]<br />LabeledValue \| LabeledValue\[] | - | |
| value | 指定当前选中的条目,多选时为一个数组。(value 数组引用未变化时,Select 不会更新) | string \| string\[]<br />number \| number\[]<br />LabeledValue \| LabeledValue\[] | - | |
| virtual | 设置 false 时关闭虚拟滚动 | boolean | true | 4.1.0 |
| onBlur | 失去焦点时回调 | function | - | |
| onChange | 选中 option,或 input 的 value 变化时,调用此函数 | function(value, option:Option \| Array&lt;Option>) | - | |
@ -82,26 +82,26 @@ cover: https://gw.alipayobjects.com/zos/alicdn/_0XzgOis7/Select.svg
### Select Methods
| 名称 | 说明 | 版本 |
| --- | --- | --- |
| blur() | 取消焦点 | |
| focus() | 获取焦点 | |
| 名称 | 说明 | 版本 |
| ------- | -------- | ---- |
| blur() | 取消焦点 | |
| focus() | 获取焦点 | |
### Option props
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| className | Option 器类名 | string | - | |
| disabled | 是否禁用 | boolean | false | |
| title | 选中该 Option 后,Select 的 title | string | - | |
| value | 默认根据此属性值进行筛选 | string \| number | - | |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --------- | --------------------------------- | ---------------- | ------ | ---- |
| className | Option 器类名 | string | - | |
| disabled | 是否禁用 | boolean | false | |
| title | 选中该 Option 后,Select 的 title | string | - | |
| value | 默认根据此属性值进行筛选 | string \| number | - | |
### OptGroup props
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| key | Key | string | - | |
| label | 组名 | string \| React.Element | - | |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| ----- | ---- | ----------------------- | ------ | ---- |
| key | Key | string | - | |
| label | 组名 | string \| React.Element | - | |
## FAQ

Loading…
Cancel
Save