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) - 🌟 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) - 🌟 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. - 🌟 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) - 🌟 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. - 🌟 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) - 🌟 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` 时,改为非受控模式。 - 🌟 `value``undefined` 时,改为非受控模式。
- 🌟 TreeSelect 使用虚拟滚动并优化键盘支持。[#19040](https://github.com/ant-design/ant-design/pull/19040) - 🌟 TreeSelect 使用虚拟滚动并优化键盘支持。[#19040](https://github.com/ant-design/ant-design/pull/19040)
- 🌟 `value``undefined` 时,改为非受控模式。 - 🌟 `value``undefined` 时,改为非受控模式。
- 🌟 `value` 引用未变化时,不再重新渲染多选 Select。
- 🌟 Button 添加 `danger``default``link` 样式。[#19837](https://github.com/ant-design/ant-design/pull/19837) - 🌟 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) - 🌟 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) - 🌟 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 | - | | | suffixIcon | The custom suffix icon | ReactNode | - | |
| tagRender | Customize tag render | (props) => ReactNode | - | | | tagRender | Customize tag render | (props) => ReactNode | - | |
| tokenSeparators | Separator used to tokenize on `tag` and `multiple` mode | string\[] | - | | | 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 | | virtual | Disable virtual scroll when set to false | boolean | true | 4.1.0 |
| onBlur | Called when blur | function | - | | | onBlur | Called when blur | function | - | |
| onChange | Called when select an option or input value change | function(value, option:Option \| Array&lt;Option>) | - | | | 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 ### Select Methods
| Name | Description | Version | | Name | Description | Version |
| --- | --- | --- | | ------- | ------------ | ------- |
| blur() | Remove focus | | | blur() | Remove focus | |
| focus() | Get focus | | | focus() | Get focus | |
### Option props ### Option props
| Property | Description | Type | Default | Version | | Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- | | --------- | ------------------------------------------ | ---------------- | ------- | ------- |
| className | The additional class to option | string | - | | | className | The additional class to option | string | - | |
| disabled | Disable this option | boolean | false | | | disabled | Disable this option | boolean | false | |
| title | `title` of Select after select this Option | string | - | | | title | `title` of Select after select this Option | string | - | |
| value | Default to filter with this property | string \| number | - | | | value | Default to filter with this property | string \| number | - | |
### OptGroup props ### OptGroup props
| Property | Description | Type | Default | Version | | Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- | | -------- | ----------- | ----------------------- | ------- | ------- |
| key | Group key | string | - | | | key | Group key | string | - | |
| label | Group label | string \| React.Element | - | | | label | Group label | string \| React.Element | - | |
## FAQ ## FAQ

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

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

Loading…
Cancel
Save