gpt4 book ai didi

reactjs - Pickers Material ui,错误仅以英文显示

转载 作者:行者123 更新时间:2023-12-04 15:30:47 24 4
gpt4 key购买 nike

在我的 React 应用程序中,我正在使用 Material UI 选择器,我希望错误将以意大利语显示。意大利语的日历没问题,我以这种方式指定它,这要归功于时刻:

import * as moment from 'moment'
import 'moment/locale/it'

但是这个声明似乎对采摘者不起作用。有人可以帮助我吗?

enter image description here

更新了工作示例 => https://60qb9.csb.app/

最佳答案

您可以使用 KeyboardDatePickerinvalidDateMessage 属性:

<KeyboardDatePicker
disableToolbar
variant="inline"
format="MM/dd/yyyy"
margin="normal"
id="date-picker-inline"
label="Date picker inline"
value={selectedDate}
onChange={handleDateChange}
KeyboardButtonProps={{
"aria-label": "change date"
}}
invalidDateMessage="Computer says no"
/>

此处为实例:https://codesandbox.io/s/material-picker-set-invalid-date-message-rn2in

关于reactjs - Pickers Material ui,错误仅以英文显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61275474/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com