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

SelectFormField jsxdata 支持接收 { key, label } 格式的数据并作为默认格式 #158

Open
ex90rts opened this issue Oct 17, 2018 · 1 comment

Comments

@ex90rts
Copy link

ex90rts commented Oct 17, 2018

目前如果通过 jsxdata 传 options 数据给 SelectFormField,只支持 { value, text } 这种格式,但是 rc-select 采用的是 { key, label } 格式,两边不一致导致经常搞混掉,建议 SelectFormField 默认改成 { key, label } 格式,同时文档中的描述也改成这个格式, { value, text } 格式仅仅作为一种兼容格式存在,不再对外透出。

包括对 jsxvalues 传过来的数据的处理。

@eternalsky
Copy link
Member

eternalsky commented Oct 17, 2018

rc-select 只有值是 {key, label},rc-select 里没有 options 属性,它传递 option 的方法是通过子组件 <Option /> (同 uxcore-select2 ),而以前 selectFormField 支持的 options 格式有 { value: text } 和 [{ value ,text }] 两种形式。新的增强是会兼容掉 [{key, label}] 的格式,但文档里还会两种格式都说明,因为老的组件里还只有前一种。jsxvalues 在搜索的情况下(配置了 onSearch 和 url 的情况下)一直是 { key, label },在非搜索的情况下是由 key 组成的数组,包括 onChange 里,和 uxcore-select2(rc-select) 保持一致。

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

2 participants