Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持label和value的区分 #10

Closed
shepherdwind opened this issue Jun 19, 2015 · 2 comments
Closed

支持label和value的区分 #10

shepherdwind opened this issue Jun 19, 2015 · 2 comments

Comments

@shepherdwind
Copy link

正常的select应该是这样的:

[
   { value: 'one', label: 'One' },
   { value: 'two', label: 'Two' }
]

选择one的时候,input显示的是One,显示的是label的值。value是one,两个还是不一样的。现在select展示的就是value的值。

https://github.com/JedWatson/react-select 这个select就是这种符合原生select模式的。

@shepherdwind shepherdwind changed the title 支持key和value的区分 支持label和value的区分 Jun 19, 2015
@shepherdwind
Copy link
Author

测试代码:

把examples/single.js里面的改成如下:

   <Option value="lucy">lucy 1</Option>
   <Option value="disabled" disabled>disabled</Option>
   <Option value="yiminghe">yiminghe 1</Option>

这时候下拉框线上的是lucy 1,选中后input的值应该也是lucy 1,但实际结果是lucy。

@xujihui1985
Copy link

image

+1 还有这个场景,Options中显示的是html, 我希望选中后,显示的displayname, 但实际取value的时候能取到domainname

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants