跳转到内容

LocalizationProvider API

想要学习更多组件属性和 CSS API,可以查阅 React LocalizationProvider 组件的 API 文档。

导入

import LocalizationProvider from '@mui/x-date-pickers-pro/LocalizationProvider';
// 或
import LocalizationProvider from '@mui/x-date-pickers/LocalizationProvider';
// 或
import { LocalizationProvider } from '@mui/x-date-pickers-pro';
// 或
import { LocalizationProvider } from '@mui/x-date-pickers';
You can learn about the difference by reading this guide on minimizing bundle size.

@ignore - do not document.

组件名称

The name MuiLocalizationProvider can be used when providing default props or style overrides in the theme.

属性

名称类型默认值描述
dateAdapter*func
DateIO adapter class function
adapterLocaleobject
| string
Locale for the date library you are using
dateFormats{ dayOfMonth?: string, fullDate?: string, fullDateTime?: string, fullDateTime12h?: string, fullDateTime24h?: string, fullDateWithWeekday?: string, fullTime?: string, fullTime12h?: string, fullTime24h?: string, hours12h?: string, hours24h?: string, keyboardDate?: string, keyboardDateTime?: string, keyboardDateTime12h?: string, keyboardDateTime24h?: string, minutes?: string, month?: string, monthAndDate?: string, monthAndYear?: string, monthShort?: string, normalDate?: string, normalDateWithWeekday?: string, seconds?: string, shortDate?: string, weekday?: string, weekdayShort?: string, year?: string }
Formats that are used for any child pickers
dateLibInstanceany
Date library instance you are using, if it has some global overrides jsx dateLibInstance={momentTimeZone}
localeobject
| string
Locale for the date library you are using
localeTextobject
Locale for components texts

组件无法持有 ref。

演示项目