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

自定义Select Option样式问题 #944

Open
chongqiangchen opened this issue May 30, 2023 · 0 comments
Open

自定义Select Option样式问题 #944

chongqiangchen opened this issue May 30, 2023 · 0 comments

Comments

@chongqiangchen
Copy link

之前在antd Issue其实是有提到这个问题,在自定义设计checkbox多选框的样式后,我觉得是非常麻烦的,我除了要自己控制value之外,还得控制onSearch,onClear,onDeselect等等保证Select的正常运行,但我却仅仅是想改变一个Option的样式仅此而已。

目前在我看来更应该在这里提,我理解rc-select是一个无样式组件,那么在Option自定义环节是否可以参考类似headlessui的设计

<RadioGroup.Option value="startup">
        {({ checked }) => (
          <span className={checked ? 'bg-blue-200' : ''}>Startup</span>
        )}
</RadioGroup.Option>

当然我的例子可能和select无关,我只是想表达我们在设计select option时候能否给使用者更大的样式控制权,组建本身也只是抛出状态,并不会破坏组件本身的逻辑。

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

1 participant