ant-design/components/select/demo/label-in-value.md

12 lines
560 B
Markdown
Raw Normal View History

2016-07-10 08:55:43 +08:00
## zh-CN
默认情况下 `onChange` 里只能拿到 `value`,如果需要拿到选中的节点文本 `label`,可以使用 `labelInValue` 属性。
2016-05-19 18:05:35 +08:00
选中项的 `label` 会被包装到 `value` 中传递给 `onChange` 等函数,此时 `value` 是一个对象。
2016-05-19 13:44:08 +08:00
2016-07-10 08:55:43 +08:00
## en-US
As a default behavior, the `onChange` callback can only get the `value` of the selected item. The `labelInValue` prop can be used to get the `label` property of the selected item.
2016-07-10 08:55:43 +08:00
The `label` of the selected item will be packed as an object for passing to the `onChange` callback.