[英]How to change the icon in MUI DatePicker?
I can't add my icon to the component.我无法将我的图标添加到组件中。
https://codesandbox.io/s/materialuipickers-material-demo-forked-soctc https://codesandbox.io/s/materialuipickers-material-demo-forked-soctc
The components
prop of DatePicker
lets you override the inner components including the OpenPickerIcon
, so this is how you override it.该
components
的道具DatePicker
让您可以覆盖内部组件,包括OpenPickerIcon
,所以这是你如何将其覆盖。 For reference, see the full API of DatePicker
here :作为参考,请在此处查看
DatePicker
的完整 API:
import AccessibleIcon from "@mui/icons-material/Accessible";
<DatePicker
components={{
OpenPickerIcon: AccessibleIcon
}}
{...}
This is the list of icon components that can be customized:这是可以自定义的图标组件列表:
{
LeftArrowIcon?: elementType,
OpenPickerIcon?: elementType,
RightArrowIcon?: elementType,
SwitchViewIcon?: elementType
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.