是否可以在React-Bootstrap-typeahead中自定义清除按钮的内容?
使用 react-bootstrap-typeahead 是否有可能更改清除按钮的内容?
我需要包含一个Fontawesome图标和“清晰”文本以匹配设计。
查看演示我可以看到 clearButton
组件,但是我看不到如何自定义。我尝试更改 label
prop,但这没有效果:
< clearbutton onClick = {onClear} label =“ clear”/>
可以添加:
- 标签文本
- 通用图标?
清除按钮的
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法自定义
clearButton
本身,但是您可以按照链接到链接的示例并使用自己的清除/关闭按钮组件:请注意,
clear> clearbutton
并不是什么特别的东西;它只是封装了Bootstrap的关闭按钮到组件中。随时使用自己的按钮!You can't customize
ClearButton
itself, but you can follow the example you linked to and use your own clear/close button component:Note that
ClearButton
isn't really anything special; it just encapsulates the markup and classnames for Bootstrap's Close Button into a component. Feel free to use your own button!