问题描述
看起来这个组件有硬编码的图标(那个图标看起来像软盘),有没有办法将图标作为道具传入并让它渲染那个?
Looks like the component has the icon hard-coded(That icon that looks like a floppy disk), is there no way to pass in an icon as a prop and have it render that one instead?
是否有一种简单的方法可以针对特定的 React-Admin 组件执行此操作?
Is there an easy way to do this for specifically React-Admin components?
推荐答案
这将在下一个主要版本中成为可能:2.5.0
(请参阅 https://github.com/marmelab/react-admin/pull/2556).
This will be possible in the next major version: 2.5.0
(see https://github.com/marmelab/react-admin/pull/2556).
在此之前,您可以通过查看代码(https://github.com/marmelab/react-admin/blob/master/packages/ra-ui-materialui/src/button/SaveButton.js)
Until then, you can implement your own button using material-ui by looking at the code (https://github.com/marmelab/react-admin/blob/master/packages/ra-ui-materialui/src/button/SaveButton.js)
这篇关于如何在 React-Admin 中更改 SaveButton 图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!