我已经在页面上添加了DatePicker,但是我有点像这样,为什么它会发生?我应该在index.html中添加一些标记,还是应该怎么做?
import 'date-fns'
import React from 'react'
import DateFnsUtils from '@date-io/date-fns'
import { MuiPickersUtilsProvider, DatePicker } from 'material-ui-pickers'
function DatePickerField (
{
input,
className,
selectedDate,
input: { name, onChange, value },
label,
meta: { touched, error },
required,
...restProps
}
) {
return (
<MuiPickersUtilsProvider
utils={DateFnsUtils}
className={className}
required={required}
error={!!(touched && error)}
>
<DatePicker
{...restProps}
label={label}
value={selectedDate}
onChange={(event, value) => input.onChange(event, value)}
name={name}
/>
</MuiPickersUtilsProvider>
)
}
export default DatePickerField
答案 0 :(得分:0)
https://material-ui-pickers.firebaseapp.com/installation-在这里您可以找到响应,在index.html
文件<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">